You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
486 B
25 lines
486 B
@echo off
|
|
setlocal
|
|
|
|
rem 测试文件列表
|
|
set tests=simple_test.c factorial.c nested_loop.c error_test.c
|
|
|
|
rem 逐个编译和运行每个测试文件
|
|
for %%t in (%tests%) do (
|
|
rem 获取文件名
|
|
set filename=%%~nt
|
|
|
|
rem 编译 C 文件
|
|
gcc %%t -o %%~nt.exe
|
|
if errorlevel 1 (
|
|
echo Compilation failed for %%t.
|
|
) else (
|
|
echo Running %%t...
|
|
%%~nt.exe
|
|
)
|
|
|
|
echo ----------------------------
|
|
)
|
|
|
|
endlocal
|
|
pause |