utilize odin test -all-packages instead of (make/bat) scripts for running tests

This commit is contained in:
Laytan Laats
2024-06-07 15:50:00 +02:00
parent 68781f8dd3
commit 0a528777e8
26 changed files with 130 additions and 505 deletions
-24
View File
@@ -1,24 +0,0 @@
ODIN=../../odin
COMMON=-file -vet -strict-style -o:minimal
all: all_bsd asan_test
all_bsd: rtti_test map_test pow_test 128_test string_compare_test
rtti_test:
$(ODIN) test test_rtti.odin $(COMMON)
map_test:
$(ODIN) test test_map.odin $(COMMON)
pow_test:
$(ODIN) test test_pow.odin $(COMMON)
128_test:
$(ODIN) test test_128.odin $(COMMON)
string_compare_test:
$(ODIN) test test_string_compare.odin $(COMMON)
asan_test:
$(ODIN) test test_asan.odin $(COMMON) -sanitize:address -debug
-9
View File
@@ -1,9 +0,0 @@
@echo off
set PATH_TO_ODIN==..\..\odin
set COMMON=-file -vet -strict-style -o:minimal
%PATH_TO_ODIN% test test_rtti.odin %COMMON% || exit /b
%PATH_TO_ODIN% test test_map.odin %COMMON% || exit /b
%PATH_TO_ODIN% test test_pow.odin %COMMON% || exit /b
%PATH_TO_ODIN% test test_asan.odin %COMMON% || exit /b
%PATH_TO_ODIN% test test_128.odin %COMMON% || exit /b
%PATH_TO_ODIN% test test_string_compare.odin %COMMON% || exit /b
+1 -1
View File
@@ -1,4 +1,4 @@
package test_128
package test_internal
import "core:testing"
+1 -1
View File
@@ -1,5 +1,5 @@
// Intended to contain code that would trigger asan easily if the abi was set up badly.
package test_asan
package test_internal
import "core:testing"
+2 -2
View File
@@ -1,4 +1,4 @@
package test_internal_map
package test_internal
import "core:log"
import "base:intrinsics"
@@ -309,4 +309,4 @@ set_delete_random_key_value :: proc(t: ^testing.T) {
}
seed_incr += 1
}
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
package test_internal_math_pow
package test_internal
@(require) import "core:log"
import "core:math"
@@ -42,4 +42,4 @@ pow_test :: proc(t: ^testing.T) {
testing.expectf(t, _v1 == _v2, "Expected math.pow2_f16(%d) == math.pow(2, %d) (= %04x), got %04x", exp, exp, _v1, _v2)
}
}
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
package test_internal_rtti
package test_internal
import "core:fmt"
import "core:testing"
@@ -43,4 +43,4 @@ rtti_test :: proc(t: ^testing.T) {
l_s := fmt.tprintf("%s", l_buggy)
testing.expectf(t, g_s == EXPECTED_REPR, "Expected fmt.tprintf(\"%%s\", g_s)) to return \"%v\", got \"%v\"", EXPECTED_REPR, g_s)
testing.expectf(t, l_s == EXPECTED_REPR, "Expected fmt.tprintf(\"%%s\", l_s)) to return \"%v\", got \"%v\"", EXPECTED_REPR, l_s)
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
package test_internal_string_compare
package test_internal
import "core:testing"
@@ -54,4 +54,4 @@ string_compare :: proc(t: ^testing.T) {
}
}
}
}
}