From: Brendan Hansen Date: Wed, 9 Jun 2021 19:34:51 +0000 (-0500) Subject: added test.bat X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=8d3b93cedbde951822490b19e285d12c96095313;p=onyx.git added test.bat --- diff --git a/bin/test.bat b/bin/test.bat new file mode 100644 index 00000000..d8ef90f6 --- /dev/null +++ b/bin/test.bat @@ -0,0 +1,43 @@ +@echo off + +set ONYX_DIR=\dev\onyx + +set failed=0 +for /r tests %%v in (*.onyx) do ( + echo Checking %%~pv%%~nv.onyx + + set ERRORLEVEL=0 + %ONYX_DIR%\onyx.exe -r js --use-post-mvp-features "%%v" -o "%ONYX_DIR%\tests\%%~nv.wasm" + if %ERRORLEVEL% GEQ 1 ( + echo Failed to compile %%~nv.onyx. + set failed=1 + goto ::continue:: + ) + + set ERRORLEVEL=0 + node %ONYX_DIR%\bin\onyx-js "%ONYX_DIR%\tests\%%~nv.wasm" > %ONYX_DIR%\tmpoutput + if %ERRORLEVEL% GEQ 1 ( + echo Failed to run %%~nv.onyx. + set failed=1 + goto ::continue:: + ) + + set ERRORLEVEL=0 + fc %ONYX_DIR%\tmpoutput "%%~pv%%~nv" > nul + if %ERRORLEVEL% GEQ 1 ( + echo Output did not match for %%~nv.onyx. + set failed=1 + goto ::continue:: + ) + +::continue:: + del %ONYX_DIR%\tests\%%~nv.wasm > nul +) + +del %ONYX_DIR%\tmpoutput + +if %failed% NEQ 0 ( + echo Some of the test cases failed. +) else ( + echo All test cases passed. +) \ No newline at end of file