def test(self):
"""
Runs the binutils `make check`
"""
ret = build.make(self.src_dir, extra_args='check', ignore_status=True)
errors = 0
for root, _, filenames in os.walk(self.src_dir):
for filename in fnmatch.filter(filenames, '*.log'):
filename = os.path.join(root, filename)
logfile = filename[:-4] + ".log"
os.system('cp ' + logfile + ' ' + self.logdir)
with open(logfile) as result:
for line in result.readlines():
if line.startswith('FAIL'):
errors += 1
self.log.error(line)
if errors:
self.fail("%s test(s) failed, check the log for details." % errors)
elif ret:
self.fail("'make check' finished with %s, but no FAIL lines were "
"found." % ret)
评论列表
文章目录