1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
SETLOCAL
if "%1x"=="debugx" goto do_debug
set EXE_PATH=visualc\Release
goto setpath
:do_debug
set EXE_PATH=visualc\Debug
goto setpath
:setpath
set PATH=%CD%\%EXE_PATH%;%PATH%
set fail_count=0
%EXE_PATH%\tester.exe tester-testsuite.lua
if %ERRORLEVEL%==0 goto unit-testsuite.lua
@echo tester-testsuite.lua failed.
set fail_count=1
:unit-testsuite.lua
%EXE_PATH%\tester.exe unit-testsuite.lua
if %ERRORLEVEL%==0 goto lua-testsuite.lua
@echo unit-testsuite.lua failed.
if %fail_count%==1 set fail_count=2
if %fail_count%==0 set fail_count=1
:lua-testsuite.lua
%EXE_PATH%\tester.exe lua-testsuite.lua
if %ERRORLEVEL%==0 goto nomore
@echo lua-testsuite.lua failed.
if %fail_count%==2 set fail_count=3
if %fail_count%==1 set fail_count=2
if %fail_count%==0 set fail_count=1
:nomore
if %fail_count%==0 goto end
@rem return an error code
@echo ===============================
@echo %fail_count% of 3 tests failed.
@echo ===============================
exit /B 1
:end
@echo ===============================
@echo All tests succeeded!
@echo ===============================
|