未验证 提交 4325da39 编写于 作者: R risemeup1 提交者: GitHub

Modify test file (#47544)

* 修改.gitigore文件,把ljd_sh文件忽略掉

* 修复改动单测文件没有触发精准测试的问题

* 取消改动.gitignore

* 修复改动单测没有出发精准测试的问题

* 修改变量名含义更加容易理解,test=coverage
上级 ad39043f
......@@ -278,18 +278,20 @@ class PRChecker(object):
all_counts = line.split()[-1]
return int(all_counts)
def file_is_unnit_test(self, filename):
def file_is_unnit_test(self, unittest_path):
# get all testcases by ctest-N
all_ut_file = '%s/build/all_ut_file' % PADDLE_ROOT
os.system(
"cd %s/build && ctest -N | awk -F ': ' '{print $2}' | sed '/^$/d' | sed '$d' > %s"
% (PADDLE_ROOT, all_ut_file)
)
(unittest_directory, unittest_name) = os.path.split(unittest_path)
# determine whether filename is in all_ut_case
with open(all_ut_file, 'r') as f:
(filepath, tempfilename) = os.path.split(filename)
for f_file in f:
if f_file.strip('\n') == tempfilename.split(".")[0]:
all_unittests = f.readlines()
for test in all_unittests:
test = test.replace('\n', '').strip()
if test == unittest_name.split(".")[0]:
return True
else:
return False
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册