add unit tests
saveload fixes
This commit is contained in:
90
run_tests.bat
Normal file
90
run_tests.bat
Normal file
@@ -0,0 +1,90 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
echo Automated Test Suite Runner
|
||||
echo ============================
|
||||
echo.
|
||||
echo Scanning for test files in tests\ directory...
|
||||
|
||||
set total_tests=0
|
||||
set failed_tests=0
|
||||
|
||||
echo.
|
||||
echo Discovered test files:
|
||||
|
||||
call :discover_tests "tests" ""
|
||||
call :discover_tests "tests\unit" "Unit: "
|
||||
call :discover_tests "tests\integration" "Integration: "
|
||||
|
||||
echo.
|
||||
echo Starting test execution...
|
||||
echo.
|
||||
|
||||
call :run_tests "tests" ""
|
||||
call :run_tests "tests\unit" "Unit: "
|
||||
call :run_tests "tests\integration" "Integration: "
|
||||
|
||||
set /a passed_tests=total_tests-failed_tests
|
||||
|
||||
echo ================================
|
||||
echo Test Execution Summary
|
||||
echo ================================
|
||||
echo Total Tests Run: !total_tests!
|
||||
echo Tests Passed: !passed_tests!
|
||||
echo Tests Failed: !failed_tests!
|
||||
|
||||
if !failed_tests! equ 0 (
|
||||
echo ALL TESTS PASSED!
|
||||
) else (
|
||||
echo !failed_tests! TEST(S) FAILED
|
||||
)
|
||||
|
||||
pause
|
||||
goto :eof
|
||||
|
||||
:discover_tests
|
||||
set "test_dir=%~1"
|
||||
set "prefix=%~2"
|
||||
if exist "%test_dir%\" (
|
||||
for %%f in ("%test_dir%\test_*.gd") do (
|
||||
call :format_test_name "%%~nf" test_name
|
||||
echo %prefix%!test_name!: %%f
|
||||
)
|
||||
)
|
||||
goto :eof
|
||||
|
||||
:run_tests
|
||||
set "test_dir=%~1"
|
||||
set "prefix=%~2"
|
||||
if exist "%test_dir%\" (
|
||||
for %%f in ("%test_dir%\test_*.gd") do (
|
||||
call :format_test_name "%%~nf" test_name
|
||||
call :run_single_test "%%f" "%prefix%!test_name!"
|
||||
)
|
||||
)
|
||||
goto :eof
|
||||
|
||||
:format_test_name
|
||||
set "filename=%~1"
|
||||
set "result=%filename:test_=%"
|
||||
set "%~2=%result:_= %"
|
||||
goto :eof
|
||||
|
||||
:run_single_test
|
||||
set "test_file=%~1"
|
||||
set "test_name=%~2"
|
||||
|
||||
echo.
|
||||
echo === %test_name% ===
|
||||
echo Running: %test_file%
|
||||
|
||||
godot --headless --script "%test_file%"
|
||||
if !errorlevel! equ 0 (
|
||||
echo PASSED: %test_name%
|
||||
) else (
|
||||
echo FAILED: %test_name%
|
||||
set /a failed_tests+=1
|
||||
)
|
||||
set /a total_tests+=1
|
||||
echo.
|
||||
goto :eof
|
||||
Reference in New Issue
Block a user