diff options
| author | Damian Tarnawski <gthetarnav@gmail.com> | 2025-09-11 00:37:38 +0200 |
|---|---|---|
| committer | Damian Tarnawski <gthetarnav@gmail.com> | 2025-09-11 00:37:38 +0200 |
| commit | ac970c5ea6cb7dfff3be9f585787339691b6b9df (patch) | |
| tree | 83bbdb5a32dee43acdcd3714a3a315c1b02643e2 | |
| parent | c38a228ad96efd1b2cf9f5f1c6a3b9489fd34b70 (diff) | |
Correct single_test and add build_test build script commands
| -rw-r--r-- | build.bat | 2 | ||||
| -rwxr-xr-x | build.sh | 21 |
2 files changed, 22 insertions, 1 deletions
@@ -11,6 +11,8 @@ if "%1" == "test" ( odin test tests -collection:src=src -debug -define:ODIN_TEST_THREADS=1 -define:ODIN_TEST_TRACK_MEMORY=false -extra-linker-flags:"/STACK:4000000,2000000" ) else if "%1" == "single_test" ( odin test tests -collection:src=src -define:ODIN_TEST_NAMES=%2 -define:ODIN_TEST_TRACK_MEMORY=false -debug -extra-linker-flags:"/STACK:4000000,2000000" +) else if "%1" == "build_test" ( + odin build tests -build-mode:test -collection:src=src -define:ODIN_TEST_THREADS=1 -define:ODIN_TEST_TRACK_MEMORY=false -extra-linker-flags:"/STACK:4000000,2000000" %2 ) else if "%1" == "debug" ( odin build src\ -show-timings -microarch:native -collection:src=src -out:ols.exe -o:minimal -no-bounds-check -use-separate-modules -debug -extra-linker-flags:"/STACK:4000000,2000000" -define:VERSION=%version%-debug ) else ( @@ -10,7 +10,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:src=../src -test-name:$@ -define:ODIN_TEST_THREADS=1 -define:ODIN_TEST_TRACK_MEMORY=false + odin test ../tests -collection:src=../src -define:ODIN_TEST_NAMES=$@ -define:ODIN_TEST_THREADS=1 -define:ODIN_TEST_TRACK_MEMORY=false shift @@ -40,6 +40,25 @@ then exit 0 fi + +if [[ $1 == "build_test" ]] +then + shift + + #BUG in odin test, it makes the executable with the same name as a folder and gets confused. + cd tests + + odin build ../tests -build-mode:test -collection:src=../src $@ -define:ODIN_TEST_THREADS=1 -define:ODIN_TEST_TRACK_MEMORY=false + + if ([ $? -ne 0 ]) + then + echo "Build failed" + exit 1 + fi + + exit 0 +fi + if [[ $1 == "debug" ]] then shift |