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
评论列表
文章目录