aboutsummaryrefslogtreecommitdiff
path: root/tests/include
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-05-02 01:59:13 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-05-02 01:59:13 -0400
commit485d13375504ed8c8f03067ed738970c708d1c43 (patch)
tree658e78b9f64b15e4f15b4a889d3e0a275e23d0ed /tests/include
parent4b0fb7ee4cc6a86cf2aef26bed648f20e479f8b6 (diff)
downloadstasis-485d13375504ed8c8f03067ed738970c708d1c43.tar.gz
Fix verbosity of unit tests
* PASS output was never supposed to be permanently toggled on
Diffstat (limited to 'tests/include')
-rw-r--r--tests/include/testing.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/tests/include/testing.h b/tests/include/testing.h
index 80d5aa2..e446908 100644
--- a/tests/include/testing.h
+++ b/tests/include/testing.h
@@ -57,32 +57,39 @@ inline void stasis_testing_record_result_summary() {
size_t failed = 0;
size_t skipped = 0;
size_t passed = 0;
- int do_message;
+ int do_message = 0;
+ int do_reason = 0;
static char status_msg[255] = {0};
for (size_t i = 0; i < stasis_test_results_i; i++) {
if (stasis_test_results[i].status && stasis_test_results[i].skip) {
strcpy(status_msg, "SKIP");
do_message = 1;
+ do_reason = 1;
skipped++;
} else if (!stasis_test_results[i].status) {
strcpy(status_msg, "FAIL");
do_message = 1;
+ do_reason = 1;
failed++;
} else {
+#ifdef STASIS_TEST_VERBOSE
+ do_message = 1;
+#endif
strcpy(status_msg, "PASS");
- do_message = 0;
passed++;
}
- fprintf(stdout, "[%s] %s:%d :: %s() => %s",
- status_msg,
- stasis_test_results[i].filename,
- stasis_test_results[i].lineno,
- stasis_test_results[i].funcname,
- stasis_test_results[i].msg_assertion);
if (do_message) {
- fprintf(stdout, "\n \\_ %s", stasis_test_results[i].msg_reason);
+ fprintf(stdout, "[%s] %s:%d :: %s() => %s",
+ status_msg,
+ stasis_test_results[i].filename,
+ stasis_test_results[i].lineno,
+ stasis_test_results[i].funcname,
+ stasis_test_results[i].msg_assertion);
+ if (do_reason) {
+ fprintf(stdout, "\n \\_ %s", stasis_test_results[i].msg_reason);
+ }
+ fprintf(stdout, "\n");
}
- fprintf(stdout, "\n");
}
fprintf(stdout, "\n[UNIT] %zu tests passed, %zu tests failed, %zu tests skipped out of %zu\n", passed, failed, skipped, stasis_test_results_i);
}