aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamian Tarnawski <gthetarnav@gmail.com>2025-09-11 00:37:38 +0200
committerDamian Tarnawski <gthetarnav@gmail.com>2025-09-11 00:37:38 +0200
commitac970c5ea6cb7dfff3be9f585787339691b6b9df (patch)
tree83bbdb5a32dee43acdcd3714a3a315c1b02643e2
parentc38a228ad96efd1b2cf9f5f1c6a3b9489fd34b70 (diff)
Correct single_test and add build_test build script commands
-rw-r--r--build.bat2
-rwxr-xr-xbuild.sh21
2 files changed, 22 insertions, 1 deletions
diff --git a/build.bat b/build.bat
index 387210e..5453c38 100644
--- a/build.bat
+++ b/build.bat
@@ -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 (
diff --git a/build.sh b/build.sh
index 6168842..c0a652a 100755
--- a/build.sh
+++ b/build.sh
@@ -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