aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeoramund <161657516+Feoramund@users.noreply.github.com>2024-06-15 13:26:40 -0400
committerFeoramund <161657516+Feoramund@users.noreply.github.com>2024-06-15 15:44:56 -0400
commit5dfd303fd15750f2128f6f45b8d3ef157a2090d8 (patch)
treeeb4e0704396b6528975d2f023f25ed1debabdcec
parenta619ea3bcdbf170b8eebafde222a9df387284ee4 (diff)
Setup default `context.random_generator` for tests
-rw-r--r--core/testing/runner.odin4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/testing/runner.odin b/core/testing/runner.odin
index a0f9eee31..01464e1aa 100644
--- a/core/testing/runner.odin
+++ b/core/testing/runner.odin
@@ -9,6 +9,7 @@ import "core:encoding/ansi"
import "core:fmt"
import "core:io"
@require import pkg_log "core:log"
+import "core:math/rand"
import "core:mem"
import "core:os"
import "core:slice"
@@ -108,6 +109,9 @@ run_test_task :: proc(task: thread.Task) {
free_all(context.temp_allocator)
+ random_generator_state := rand.create(data.t.seed)
+ context.random_generator = rand.default_random_generator(&random_generator_state)
+
data.it.p(&data.t)
end_t(&data.t)