aboutsummaryrefslogtreecommitdiff
path: root/core/testing/runner.odin
diff options
context:
space:
mode:
authorFeoramund <161657516+Feoramund@users.noreply.github.com>2025-06-16 10:50:56 -0400
committerFeoramund <161657516+Feoramund@users.noreply.github.com>2025-06-16 11:25:32 -0400
commit71c6b0c8f0fe77ecd98bbe2aaebd261f9e544d47 (patch)
tree0daf9d0130db37ea07aff8cc8cd8accadff6bb0d /core/testing/runner.odin
parent1bd48df41febbcf0f903fdfc697f59527b03bbe9 (diff)
testing: Add API to expect signals and assertion failures
Diffstat (limited to 'core/testing/runner.odin')
-rw-r--r--core/testing/runner.odin11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/testing/runner.odin b/core/testing/runner.odin
index 56d561d3d..cb1da9445 100644
--- a/core/testing/runner.odin
+++ b/core/testing/runner.odin
@@ -741,7 +741,8 @@ runner :: proc(internal_tests: []Internal_Test) -> bool {
if test_index, reason, ok := should_stop_test(); ok {
- #no_bounds_check report.all_test_states[test_index] = .Failed
+ passed := reason == .Successful_Stop
+ #no_bounds_check report.all_test_states[test_index] = .Successful if passed else .Failed
#no_bounds_check it := internal_tests[test_index]
#no_bounds_check pkg := report.packages_by_name[it.pkg]
pkg.frame_ready = false
@@ -762,7 +763,7 @@ runner :: proc(internal_tests: []Internal_Test) -> bool {
fmt.assertf(task_data != nil, "A signal (%v) was raised to stop test #%i %s.%s, but its task data is missing.",
reason, test_index, it.pkg, it.name)
- if !task_data.t._fail_now_called {
+ if !passed && !task_data.t._fail_now_called {
if test_index not_in failed_test_reason_map {
// We only write a new error message here if there wasn't one
// already, because the message we can provide based only on
@@ -780,7 +781,11 @@ runner :: proc(internal_tests: []Internal_Test) -> bool {
end_t(&task_data.t)
- total_failure_count += 1
+ if passed {
+ total_success_count += 1
+ } else {
+ total_failure_count += 1
+ }
total_done_count += 1
}