未验证 提交 0f78ddb9 编写于 作者: Y YUNSHEN XIE 提交者: GitHub

Fix path error on windows (#33122)

* fix path error on windows when precision switch is turn on

* fix error

* Update get_pr_ut.py

fix format error

* Update get_pr_ut.py
上级 a9869297
...@@ -248,13 +248,15 @@ class PRChecker(object): ...@@ -248,13 +248,15 @@ class PRChecker(object):
return True return True
def get_all_count(self): def get_all_count(self):
os.system( p = subprocess.Popen(
"cd %sbuild && ctest -N|grep 'Total Tests:' | awk -F ': ' '{print $2}' > testCount" "cd {}build && ctest -N".format(PADDLE_ROOT),
% PADDLE_ROOT) shell=True,
f = open("%sbuild/testCount" % PADDLE_ROOT) stdout=subprocess.PIPE)
testCount = f.read() out, err = p.communicate()
f.close() for line in out.splitlines():
return int(testCount.strip()) if 'Total Tests:' in str(line):
all_counts = line.split()[-1]
return int(all_counts)
def get_pr_ut(self): def get_pr_ut(self):
""" Get unit tests in pull request. """ """ Get unit tests in pull request. """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册