From b19ad118dd561b7703a3313066f7cfea1884a0d0 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Wed, 1 Apr 2020 16:04:41 +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 reports if some unmet dependencies are missing. Signed-off-by: Ronald Cron --- tests/suites/host_test.function | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/suites/host_test.function b/tests/suites/host_test.function index aff49ca56..5951e465a 100644 --- a/tests/suites/host_test.function +++ b/tests/suites/host_test.function @@ -476,6 +476,7 @@ int execute_tests( int argc , const char ** argv ) { size_t unmet_dep_count = 0; int unmet_dependencies[20]; + int missing_unmet_dependencies = 0; test_filename = test_files[ testfile_index ]; @@ -496,6 +497,7 @@ int execute_tests( int argc , const char ** argv ) mbedtls_exit( MBEDTLS_EXIT_FAILURE ); } unmet_dep_count = 0; + missing_unmet_dependencies = 0; if( ( ret = get_line( file, buf, sizeof(buf) ) ) != 0 ) break; @@ -527,6 +529,10 @@ int execute_tests( int argc , const char ** argv ) unmet_dependencies[unmet_dep_count] = dep_id; unmet_dep_count++; } + else + { + missing_unmet_dependencies = 1; + } } } @@ -595,11 +601,14 @@ int execute_tests( int argc , const char ** argv ) mbedtls_fprintf( stdout, "%d ", 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 ) {