cmocka: Print test errors directly to make them included in the XML output
authorJakub Hrozek <jakub.hrozek@posteo.se>
Tue, 10 Feb 2015 12:03:03 +0000 (13:03 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 10 Feb 2015 14:08:00 +0000 (15:08 +0100)
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
src/cmocka.c

index f8cd201..26a268d 100644 (file)
@@ -2405,6 +2405,7 @@ static int cmocka_run_one_tests(struct CMUnitTestState *test_state)
                                             test_state->check_point);
         if (rc != 0) {
             test_state->status = CM_TEST_ERROR;
+            cm_print_error("Test setup failed");
         }
     }
 
@@ -2444,6 +2445,7 @@ static int cmocka_run_one_tests(struct CMUnitTestState *test_state)
                                             test_state->check_point);
         if (rc != 0) {
             test_state->status = CM_TEST_ERROR;
+            cm_print_error("Test teardown failed");
         }
     }