zipout.py 文件源码

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

项目:compilers-class-hw 作者: anoopsarkar 项目源码 文件源码
def run_all(self):
        # check that a compiled binary exists to run on the testcases
        argv = os.path.abspath(os.path.join(self.answer_dir, self.run_program))
        if not (os.path.isfile(argv) and os.access(argv, os.X_OK)):
            logging.error("executable missing: {0}".format(argv))
            print >>sys.stderr, "Compile your source file to create an executable {0}".format(argv)
            sys.exit(1)

        # check if testcases has subdirectories
        testcase_subdirs = iocollect.getdirs(os.path.abspath(self.testcase_dir))

        if len(testcase_subdirs) > 0:
            for subdir in testcase_subdirs:
                files = iocollect.getfiles(os.path.abspath(os.path.join(self.testcase_dir, subdir)))
                self.run_path(subdir, files)
        else:
            files = iocollect.getfiles(os.path.abspath(self.testcase_dir))
            self.run_path(None, files)

        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号