From 75d26b5d17bd8644db531122ceb38fd96faa995c Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Fri, 3 Apr 2020 15:46:53 +0200 Subject: [PATCH] unit tests: Indicate missing unmet dependencies The identifiers of the unmet dependencies of a test case are stored in a buffer of fixed size that can be potentially too small to store all the unmet dependencies. Indicate in test report if some unmet dependencies are missing. Signed-off-by: Ronald Cron --- tests/suites/main_test.function | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/suites/main_test.function b/tests/suites/main_test.function index 57e8c8305..9b2fa2b97 100644 --- a/tests/suites/main_test.function +++ b/tests/suites/main_test.function @@ -350,6 +350,7 @@ int main(int argc, const char *argv[]) { size_t unmet_dep_count = 0; char *unmet_dependencies[20]; /* only filled when verbose != 0 */ + int missing_unmet_dependencies = 0; test_filename = test_files[ testfile_index ]; @@ -371,6 +372,7 @@ int main(int argc, const char *argv[]) } unmet_dep_count = 0; memset( unmet_dependencies, 0, sizeof( unmet_dependencies ) ); + missing_unmet_dependencies = 0; if( ( ret = get_line( file, buf, sizeof(buf) ) ) != 0 ) break; @@ -409,6 +411,10 @@ int main(int argc, const char *argv[]) } unmet_dep_count++; } + else + { + missing_unmet_dependencies = 1; + } } } @@ -468,11 +474,14 @@ int main(int argc, const char *argv[]) unmet_dependencies[i]); free(unmet_dependencies[i]); } + if( missing_unmet_dependencies ) + mbedtls_fprintf( stdout, "..." ); } mbedtls_fprintf( stdout, "\n" ); fflush( stdout ); unmet_dep_count = 0; + missing_unmet_dependencies = 0; } else if( ret == DISPATCH_TEST_SUCCESS ) {