From 901f000523be0f5002b320bef8f8936d715d0a16 Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Wed, 28 Jul 2021 12:23:46 +1200 Subject: [PATCH] Fixed quick_tests return codes. Signed-off-by: Timothy Manning --- .../unit_tests/quick_tests/quick_tests.c | 11 +++++++---- .../unit_tests/quick_tests/quick_tests.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/direct/test-framework/unit_tests/quick_tests/quick_tests.c b/direct/test-framework/unit_tests/quick_tests/quick_tests.c index e015d02..21a0cf3 100644 --- a/direct/test-framework/unit_tests/quick_tests/quick_tests.c +++ b/direct/test-framework/unit_tests/quick_tests/quick_tests.c @@ -48,7 +48,7 @@ int main(int argc, char *argv[]) run_random_test_loop(); } /*this is where the loop should break to*/ - quit_quick_tests(0); + quit_quick_tests(); } @@ -102,7 +102,7 @@ void run_test(int x) get_error(); print_message("\n\n",1); if (get_exit_on_error()){ - quit_quick_tests(1); + quit_quick_tests(); } } output=0; @@ -116,7 +116,7 @@ void run_test(int x) get_error(); printf("\n\n"); if (get_exit_on_error()){ - quit_quick_tests(1); + quit_quick_tests(); } } else { @@ -130,7 +130,7 @@ void run_test(int x) delete_dir(TEST_DIR); } -void quit_quick_tests(int exit_code) +void quit_quick_tests() { /*char message[30]; message[0]='\0'; @@ -140,6 +140,9 @@ void quit_quick_tests(int exit_code) } printf("out of %d tests, %d ran: %d passed and %d failed\n\n\n", total_number_of_tests,(num_of_tests_pass+num_of_tests_failed) ,num_of_tests_pass,num_of_tests_failed); yaffs_unmount(YAFFS_MOUNT_POINT); + + //remember that the exit_code needs to be 0 when all the tests pass. + int exit_code = num_of_tests_failed != 0; exit(exit_code); } diff --git a/direct/test-framework/unit_tests/quick_tests/quick_tests.h b/direct/test-framework/unit_tests/quick_tests/quick_tests.h index 2586fa1..9644ae7 100644 --- a/direct/test-framework/unit_tests/quick_tests/quick_tests.h +++ b/direct/test-framework/unit_tests/quick_tests/quick_tests.h @@ -520,7 +520,7 @@ test_template test_list[]={ void logical_run_of_tests(void); void init_quick_tests(int argc, char *argv[]); -void quit_quick_tests(int exit_code); +void quit_quick_tests(); void get_error(void); void run_random_test_loop(void); void run_test(int x); -- 2.30.2