Message ID | 20240614153421.2c934dc1@rorschach.local.home (mailing list archive) |
---|---|
State | Accepted |
Commit | 340e2e673f8951f049e9250621e3a4d4e84f10dc |
Headers | show |
Series | libtraceevent: Have unit test fail when any tests fail | expand |
diff --git a/utest/trace-utest.c b/utest/trace-utest.c index a26e42e..7c4b9b6 100644 --- a/utest/trace-utest.c +++ b/utest/trace-utest.c @@ -37,6 +37,7 @@ int main(int argc, char **argv) { CU_BasicRunMode verbose = CU_BRM_VERBOSE; enum unit_tests tests = RUN_NONE; + int failed_tests; for (;;) { int c; @@ -82,6 +83,7 @@ int main(int argc, char **argv) CU_basic_set_mode(verbose); CU_basic_run_tests(); + failed_tests = CU_get_number_of_tests_failed(); CU_cleanup_registry(); - return 0; + return failed_tests != 0; }