[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] cmocka: print exact error message on test setup failure


Replace hard-coded message:

Could not run the test - check test fixtures

which is being printed by cmocka when test's setup() failed
with exact error message produced by test run.

This is allows for example to see which assertion used in
setup() failed.

Signed-off-by: Krzysztof Opasiak <k.opasiak@xxxxxxxxxxx>
---
 src/cmocka.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cmocka.c b/src/cmocka.c
index f02e412614e4..2d1af8d9b309 100644
--- a/src/cmocka.c
+++ b/src/cmocka.c
@@ -2874,7 +2874,7 @@ int _cmocka_run_group_tests(const char *group_name,
                 cmprintf(PRINTF_TEST_ERROR,
                          test_number,
                          cmtest->test->name,
-                         "Could not run the test - check test fixtures");
+			 cmtest->error_message);
                 total_errors++;
             }
         }
-- 
2.9.3


Follow-Ups:
Re: [PATCH] cmocka: print exact error message on test setup failureAndreas Schneider <asn@xxxxxxxxxxxxxx>