提交 de02e678 创建 作者: 宋海霞's avatar 宋海霞

已更改

上级 cf7921c3
......@@ -52,6 +52,7 @@ teacher-check1:
- count=$(find . -name "input*.txt" | wc -l)
- git clone ${CODECODE_PROTOCOL}gitlab-ci-token:${CI_JOB_TOKEN}@${CODECODE_DOMAIN}/${CI_PROJECT_FORKSOURCE} template
- diff template/.gitlab-ci.yml .gitlab-ci.yml -b -B -y -i --suppress-common-lines
- diff template/local_test.py local_test.py -b -B -y -i --suppress-common-lines
- for i in $(seq 1 1 $count);
do
./app.exe < input${i}.txt > /dev/null;
......
......@@ -139,6 +139,11 @@ def outputPromptInfo(bIncludeCi, promptInfo, color):
print(Fore.WHITE, file = stream)
sys.stdout.flush()
def removeResultFile(args):
for filename in args:
if os.path.isfile(filename):
os.remove(filename)
if __name__ == "__main__":
bIncludeCi = False
......@@ -159,18 +164,14 @@ if __name__ == "__main__":
exit(1)
print()
compResultFile = "result_comparation.html"
if os.path.isfile(compResultFile):
os.remove(compResultFile)
execFile = "app.exe"
if os.path.isfile(execFile):
os.remove(execFile)
execFile = "*.o"
if os.path.isfile(execFile):
os.remove(execFile)
# 清理项目
removefiles = []
files = os.listdir(".")
for f in files:
if f.endswith('.o') or f.endswith('.exe') or f.startswith('user_output') or f == "result_comparation.html":
removefiles.append(f)
removeResultFile(removefiles)
promptInfo = "正在使用make生成项目"
outputPromptInfo(bIncludeCi, promptInfo, 1)
......@@ -243,7 +244,7 @@ if __name__ == "__main__":
errorInfo = "输出结果比较异常,返回值:{0}。".format(execResult)
outputPromptInfo(bIncludeCi, errorInfo, 2)
else:
promptInfo = "提示:\n请使用以下方式打开文件的比较结果:\n选择View菜单中的Explorer菜单项,在打开的文件列表中,右击result_comparation.html文件,\n在弹出的菜单中选择\“Open Preview\”菜单项,可以打开比较结果输出文件,可帮助用户查找验证失败的原因。"
promptInfo = "提示:\n请使用以下方式打开文件的比较结果:\n选择View菜单中的Explorer菜单项,在打开的文件列表中,右击result_comparation.html文件,\n在弹出的菜单中选择“Open Preview”菜单项,可以打开比较结果输出文件,可帮助用户查找验证失败的原因。"
outputPromptInfo(bIncludeCi, promptInfo, 2)
exit(1)
seqNum = seqNum + 1
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论