aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2022-03-03 15:16:16 +0100
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2022-03-03 15:16:16 +0100
commit6d9f84ba030c3903dbfb213ee0a0e7a83d410b71 (patch)
tree89fe07fb0dc33770911aebbca9c5f076c48e9c85
parent8af08f2153294174075b569e81f421a2efd4b183 (diff)
[tests] Make test runners exit with errorlevel 1 if a test fails.
-rw-r--r--tests/core/compress/test_core_compress.odin3
-rw-r--r--tests/core/crypto/test_core_crypto.odin4
-rw-r--r--tests/core/encoding/test_core_json.odin4
-rw-r--r--tests/core/hash/test_core_hash.odin4
-rw-r--r--tests/core/image/test_core_image.odin3
-rw-r--r--tests/core/math/noise/test_core_math_noise.odin4
-rw-r--r--tests/core/odin/test_parser.odin5
-rw-r--r--tests/core/strings/test_core_strings.odin4
-rw-r--r--tests/vendor/botan/test_vendor_botan.odin4
-rw-r--r--tests/vendor/glfw/test_vendor_glfw.odin4
10 files changed, 38 insertions, 1 deletions
diff --git a/tests/core/compress/test_core_compress.odin b/tests/core/compress/test_core_compress.odin
index c925c0258..73c69445a 100644
--- a/tests/core/compress/test_core_compress.odin
+++ b/tests/core/compress/test_core_compress.odin
@@ -52,6 +52,9 @@ main :: proc() {
gzip_test(&t)
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
+ if TEST_fail > 0 {
+ os.exit(1)
+ }
}
@test
diff --git a/tests/core/crypto/test_core_crypto.odin b/tests/core/crypto/test_core_crypto.odin
index 5682a6167..f2e5b48d9 100644
--- a/tests/core/crypto/test_core_crypto.odin
+++ b/tests/core/crypto/test_core_crypto.odin
@@ -37,6 +37,7 @@ import "core:crypto/jh"
import "core:crypto/groestl"
import "core:crypto/haval"
import "core:crypto/siphash"
+import "core:os"
TEST_count := 0
TEST_fail := 0
@@ -127,6 +128,9 @@ main :: proc() {
bench_modern(&t)
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
+ if TEST_fail > 0 {
+ os.exit(1)
+ }
}
TestHash :: struct {
diff --git a/tests/core/encoding/test_core_json.odin b/tests/core/encoding/test_core_json.odin
index f536eb4c6..702086ea2 100644
--- a/tests/core/encoding/test_core_json.odin
+++ b/tests/core/encoding/test_core_json.odin
@@ -3,6 +3,7 @@ package test_core_json
import "core:encoding/json"
import "core:testing"
import "core:fmt"
+import "core:os"
TEST_count := 0
TEST_fail := 0
@@ -34,6 +35,9 @@ main :: proc() {
marshal_json(&t)
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
+ if TEST_fail > 0 {
+ os.exit(1)
+ }
}
@test
diff --git a/tests/core/hash/test_core_hash.odin b/tests/core/hash/test_core_hash.odin
index 8baa604b6..f68767612 100644
--- a/tests/core/hash/test_core_hash.odin
+++ b/tests/core/hash/test_core_hash.odin
@@ -5,6 +5,7 @@ import "core:hash"
import "core:time"
import "core:testing"
import "core:fmt"
+import "core:os"
TEST_count := 0
TEST_fail := 0
@@ -35,6 +36,9 @@ main :: proc() {
test_xxhash_vectors(&t)
test_crc64_vectors(&t)
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
+ if TEST_fail > 0 {
+ os.exit(1)
+ }
}
/*
diff --git a/tests/core/image/test_core_image.odin b/tests/core/image/test_core_image.odin
index 124166245..2171a0d92 100644
--- a/tests/core/image/test_core_image.odin
+++ b/tests/core/image/test_core_image.odin
@@ -57,6 +57,9 @@ main :: proc() {
png_test(&t)
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
+ if TEST_fail > 0 {
+ os.exit(1)
+ }
}
PNG_Test :: struct {
diff --git a/tests/core/math/noise/test_core_math_noise.odin b/tests/core/math/noise/test_core_math_noise.odin
index c3a3e4228..be89d076a 100644
--- a/tests/core/math/noise/test_core_math_noise.odin
+++ b/tests/core/math/noise/test_core_math_noise.odin
@@ -3,6 +3,7 @@ package test_core_math_noise
import "core:testing"
import "core:math/noise"
import "core:fmt"
+import "core:os"
TEST_count := 0
TEST_fail := 0
@@ -35,6 +36,9 @@ main :: proc() {
t := testing.T{}
noise_test(&t)
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
+ if TEST_fail > 0 {
+ os.exit(1)
+ }
}
Test_Vector :: struct {
diff --git a/tests/core/odin/test_parser.odin b/tests/core/odin/test_parser.odin
index 90d913d10..ef31f91db 100644
--- a/tests/core/odin/test_parser.odin
+++ b/tests/core/odin/test_parser.odin
@@ -2,7 +2,7 @@ package test_core_odin_parser
import "core:testing"
import "core:fmt"
-
+import "core:os"
import "core:odin/parser"
@@ -35,6 +35,9 @@ main :: proc() {
test_parse_demo(&t)
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
+ if TEST_fail > 0 {
+ os.exit(1)
+ }
}
diff --git a/tests/core/strings/test_core_strings.odin b/tests/core/strings/test_core_strings.odin
index fc1518349..c1f9603fd 100644
--- a/tests/core/strings/test_core_strings.odin
+++ b/tests/core/strings/test_core_strings.odin
@@ -3,6 +3,7 @@ package test_core_image
import "core:strings"
import "core:testing"
import "core:fmt"
+import "core:os"
TEST_count := 0
TEST_fail := 0
@@ -35,6 +36,9 @@ main :: proc() {
test_index_any_larger_string_found(&t)
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
+ if TEST_fail > 0 {
+ os.exit(1)
+ }
}
@test
diff --git a/tests/vendor/botan/test_vendor_botan.odin b/tests/vendor/botan/test_vendor_botan.odin
index 148eb03bd..f0ff44ac9 100644
--- a/tests/vendor/botan/test_vendor_botan.odin
+++ b/tests/vendor/botan/test_vendor_botan.odin
@@ -14,6 +14,7 @@ package test_vendor_botan
import "core:testing"
import "core:fmt"
+import "core:os"
import "vendor:botan/md4"
import "vendor:botan/md5"
@@ -86,6 +87,9 @@ main :: proc() {
test_siphash_2_4(&t)
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
+ if TEST_fail > 0 {
+ os.exit(1)
+ }
}
TestHash :: struct {
diff --git a/tests/vendor/glfw/test_vendor_glfw.odin b/tests/vendor/glfw/test_vendor_glfw.odin
index 252df2033..baf46aa7e 100644
--- a/tests/vendor/glfw/test_vendor_glfw.odin
+++ b/tests/vendor/glfw/test_vendor_glfw.odin
@@ -3,6 +3,7 @@ package test_vendor_glfw
import "core:testing"
import "core:fmt"
import "vendor:glfw"
+import "core:os"
GLFW_MAJOR :: 3
GLFW_MINOR :: 3
@@ -36,6 +37,9 @@ main :: proc() {
test_glfw(&t)
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
+ if TEST_fail > 0 {
+ os.exit(1)
+ }
}
@(test)