v4k-git-backup/TEST.bat

36 lines
913 B
Batchfile
Raw Normal View History

2024-04-15 10:07:05 +00:00
@echo off
2024-04-15 17:55:47 +00:00
2024-04-17 09:47:15 +00:00
cd /d "%~dp0\."
2024-04-15 17:55:47 +00:00
call make cook
2024-04-17 09:47:15 +00:00
mkdir tests > nul 2> nul
mkdir tests\out > nul 2> nul
mkdir tests\ref > nul 2> nul
mkdir tests\diff > nul 2> nul
2024-04-15 17:55:47 +00:00
where gm > nul 2> nul
if errorlevel 1 (
echo "gm" not found. Please install GraphicsMagick and add it to the PATH.
pause
exit /b 1
)
2024-04-15 10:07:05 +00:00
for %%x in (*.exe) do (
2024-04-17 09:47:15 +00:00
@REM echo Running %%x...
2024-04-15 17:55:47 +00:00
start /wait "" "%%x" --nocook --capture=50
2024-04-17 09:47:15 +00:00
if not exist "tests\ref\%%~nx.png" (
echo [pass] reference image not found. Copying %%~nx.png ...
copy "tests\out\%%~nx.png" "tests\ref\%%~nx.png"
2024-04-15 17:55:47 +00:00
) else (
2024-04-17 09:47:15 +00:00
call gm compare -metric MSE -maximum-error 0.005 "tests\ref\%%~nx.png" "tests\out\%%~nx.png" -file "tests\diff\%%~nx.png"
2024-04-15 17:55:47 +00:00
if errorlevel 1 (
2024-04-17 09:47:15 +00:00
echo [fail] %%~nx.exe! Check "tests\diff\%%~nx.png"
) else (
echo [pass] %%~nx.exe
del "tests\diff\%%~nx.png"
2024-04-15 17:55:47 +00:00
)
)
2024-04-15 10:07:05 +00:00
)