binutils.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:avocado-misc-tests 作者: avocado-framework 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号