Report step number when a test case fails
Allow test code to declare a "step number". Report the current step
number when a test fails.
diff --git a/tests/suites/host_test.function b/tests/suites/host_test.function
index 0f98d23..24d9b97 100644
--- a/tests/suites/host_test.function
+++ b/tests/suites/host_test.function
@@ -548,6 +548,7 @@
{
test_info.result = TEST_RESULT_SUCCESS;
test_info.paramfail_test_state = PARAMFAIL_TESTSTATE_IDLE;
+ test_info.step = (unsigned long)( -1 );
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
/* Suppress all output from the library unless we're verbose
@@ -624,9 +625,15 @@
{
total_errors++;
mbedtls_fprintf( stdout, "FAILED\n" );
- mbedtls_fprintf( stdout, " %s\n at line %d, %s\n",
- test_info.test, test_info.line_no,
- test_info.filename );
+ mbedtls_fprintf( stdout, " %s\n at ",
+ test_info.test );
+ if( test_info.step != (unsigned long)( -1 ) )
+ {
+ mbedtls_fprintf( stdout, "step %lu, ",
+ test_info.step );
+ }
+ mbedtls_fprintf( stdout, "line %d, %s",
+ test_info.line_no, test_info.filename );
}
fflush( stdout );
}