libtraceevent: Have unit test fail when any tests fail
PATCH 1/1 libtraceevent: Have unit test fail when any tests fail
From: "Steven Rostedt (Google)" <[email protected]>
If any of the tests of the unit test fails, make sure it returns non-zero to allow tools that use this know that a test failed.
Reported-by Paul Mars <[email protected]>
Signed-off-by Steven Rostedt (Google) <[email protected]>
--- utest/trace-utest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
utest/trace-utest.c +3 -1
@@ -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 ; }
Signature · 1 line
2.43.0