aboutsummaryrefslogtreecommitdiff
path: root/tests/include/testing.h
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2026-05-06 14:29:21 -0400
committerGitHub <noreply@github.com>2026-05-06 14:29:21 -0400
commitb494ddd036f9b17fcfabd42decd325bbe8be914e (patch)
tree4b722c242e454332d3eef596b68f2fad9d935fe1 /tests/include/testing.h
parente412ae6ff1aa793799ccdbe893484273e71e909a (diff)
parent17bd286713df8f76f7b5f3878e501a81fa4c04ee (diff)
downloadstasis-b494ddd036f9b17fcfabd42decd325bbe8be914e.tar.gz
Merge pull request #140 from jhunkeler/version-compare
Add version comparison code
Diffstat (limited to 'tests/include/testing.h')
-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);
}