From 92b7c847cd285e44cebebec1a7d80c111f488f8b Mon Sep 17 00:00:00 2001 From: Daniel Gavin Date: Wed, 27 Jul 2022 14:26:09 +0200 Subject: Start working on CI for odinfmt tests --- build.sh | 24 +++++++++++++----------- tools/odinfmt/tests.bat | 6 ++++-- tools/odinfmt/tests.sh | 3 +++ 3 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 tools/odinfmt/tests.sh diff --git a/build.sh b/build.sh index f09b75e..074983f 100755 --- a/build.sh +++ b/build.sh @@ -1,27 +1,29 @@ #!/usr/bin/env bash -if [[ $1 == "CI" ]] -then - ODIN="Odin/odin" -else - ODIN="odin" -fi - if [[ $1 == "CI" ]] then + export PATH=$PATH:$PWD/Odin #BUG in odin test, it makes the executable with the same name as a folder and gets confused. cd tests - ../${ODIN} test ../tests -collection:shared=../src -opt:2 + odin test ../tests -collection:shared=../src -opt:2 if ([ $? -ne 0 ]) then - echo "Test failed" + echo "Ols tests failed" exit 1 fi cd .. + + ./tools/odinfmt/tests.bat + + if ([ $? -ne 0 ]) + then + echo "Odinfmt tests failed" + exit 1 + fi fi if [[ $1 == "test" ]] @@ -29,7 +31,7 @@ then #BUG in odin test, it makes the executable with the same name as a folder and gets confused. cd tests - ${ODIN} test ../tests -collection:shared=../src + odin test ../tests -collection:shared=../src if ([ $? -ne 0 ]) then @@ -40,4 +42,4 @@ then cd .. fi -${ODIN} build src/ -show-timings -collection:shared=src -out:ols -o:speed +odin build src/ -show-timings -collection:shared=src -out:ols -o:speed diff --git a/tools/odinfmt/tests.bat b/tools/odinfmt/tests.bat index 13172ef..e5ff64d 100644 --- a/tools/odinfmt/tests.bat +++ b/tools/odinfmt/tests.bat @@ -1,2 +1,4 @@ -odin run tests.odin -file -show-timings -collection:shared=../../src -out:tests.exe - +echo off +cd /D "%~dp0" +odin run tests.odin -file -show-timings -collection:shared=../../src -out:tests.exe +if %errorlevel% neq 0 exit 1 \ No newline at end of file diff --git a/tools/odinfmt/tests.sh b/tools/odinfmt/tests.sh new file mode 100644 index 0000000..ef8e95b --- /dev/null +++ b/tools/odinfmt/tests.sh @@ -0,0 +1,3 @@ +cd "${0%/*}" +odin run tests.odin -file -show-timings -collection:shared=../../src -out:tests.exe +if ([ $? -ne 0 ]) then exit 1 fi \ No newline at end of file -- cgit v1.2.3