From 81ee673dff14f8ec110dfcaacceed2d910c2b657 Mon Sep 17 00:00:00 2001 From: Qoqnus master Date: Mon, 21 Sep 2026 10:28:31 +0330 Subject: [PATCH] test: Updated macros test_run_log and test_result_log to support logging in process of test --- test/qbuild/context/context.c | 2 +- test/qbuild/file.c | 4 ++-- test/qbuild/platform/platform.c | 2 +- test/qbuild/project/project.c | 2 +- test/qbuild/string.c | 2 +- test/test.h | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/qbuild/context/context.c b/test/qbuild/context/context.c index e440e74..f3c93bc 100644 --- a/test/qbuild/context/context.c +++ b/test/qbuild/context/context.c @@ -2,7 +2,7 @@ #include bool test_qbuild_context_create_destroy() { - test_run_log("qbuild_context_create_destroy"); + test_run_log(); qbuild_context_t ctx; bool success = 1; diff --git a/test/qbuild/file.c b/test/qbuild/file.c index a129ea0..50b4452 100644 --- a/test/qbuild/file.c +++ b/test/qbuild/file.c @@ -2,7 +2,7 @@ #include bool test_qbuild_file_path_seperate() { - test_run_log("qbuild_file_path_seperate"); + test_run_log(); const char sample[] = "test1.txt:test2.txt:test3.txt:test4.txt:test5.txt"; size_t size; char **res; @@ -20,7 +20,7 @@ bool test_qbuild_file_path_seperate() { } bool test_qbuild_file_exists() { - test_run_log("qbuild_file_exists"); + test_run_log(); bool success = 1; success &= qbuild_file_exists("Makefile"); diff --git a/test/qbuild/platform/platform.c b/test/qbuild/platform/platform.c index 5b65d63..ebfb415 100644 --- a/test/qbuild/platform/platform.c +++ b/test/qbuild/platform/platform.c @@ -2,7 +2,7 @@ #include bool test_qbuild_platform_host_name() { - test_run_log("qbuild_platform_host_name"); + test_run_log(); char *host = qbuild_platform_host_name(); bool success = true; diff --git a/test/qbuild/project/project.c b/test/qbuild/project/project.c index f17c1ad..cfedf23 100644 --- a/test/qbuild/project/project.c +++ b/test/qbuild/project/project.c @@ -3,7 +3,7 @@ #include bool test_qbuild_project_load() { - test_run_log("qbuild_project_load"); + test_run_log(); qbuild_project_t p; bool success = true; diff --git a/test/qbuild/string.c b/test/qbuild/string.c index 21d00cb..d2fb890 100644 --- a/test/qbuild/string.c +++ b/test/qbuild/string.c @@ -2,7 +2,7 @@ #include bool test_qbuild_string_lower() { - test_run_log("qbuild_string_lower"); + test_run_log(); char upper[] = "ASDfdsg/%_+"; char lower[] = "asdfdsg/%_+"; diff --git a/test/test.h b/test/test.h index 7185711..80aa5ff 100644 --- a/test/test.h +++ b/test/test.h @@ -9,8 +9,8 @@ extern "C" { #endif #define array_len(a) (sizeof(a) / sizeof(a[0])) -#define test_run_log(m) printf("[*] Running test %s: ", m) -#define test_result_log(s) printf("%s\n", s ? "passed" : "failed") +#define test_run_log() printf("[*] Running %s\n", __func__) +#define test_result_log(s) printf("[%c] %s\n", s ? '+' : '-', s ? "passed" : "failed") #ifdef __cplusplus }