mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-20 22:05:15 +00:00
Add TEST_ASSUME macro to allow skipping tests at runtime
This commit adds a macro TEST_ASSUME to the test infrastructure which allows to skip tests based on unmet conditions determined at runtime.
This commit is contained in:
parent
d82a03084f
commit
930fbf60d6
3 changed files with 43 additions and 7 deletions
|
|
@ -498,7 +498,8 @@ int execute_tests( int argc , const char ** argv )
|
|||
|
||||
if( ( ret = get_line( file, buf, sizeof(buf) ) ) != 0 )
|
||||
break;
|
||||
mbedtls_fprintf( stdout, "%s%.66s", test_info.failed ? "\n" : "", buf );
|
||||
mbedtls_fprintf( stdout, "%s%.66s",
|
||||
test_info.result == TEST_RESULT_FAILED ? "\n" : "", buf );
|
||||
mbedtls_fprintf( stdout, " " );
|
||||
for( i = strlen( buf ) + 1; i < 67; i++ )
|
||||
mbedtls_fprintf( stdout, "." );
|
||||
|
|
@ -545,7 +546,7 @@ int execute_tests( int argc , const char ** argv )
|
|||
// If there are no unmet dependencies execute the test
|
||||
if( unmet_dep_count == 0 )
|
||||
{
|
||||
test_info.failed = 0;
|
||||
test_info.result = TEST_RESULT_SUCCESS;
|
||||
test_info.paramfail_test_state = PARAMFAIL_TESTSTATE_IDLE;
|
||||
|
||||
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
|
||||
|
|
@ -610,10 +611,15 @@ int execute_tests( int argc , const char ** argv )
|
|||
}
|
||||
else if( ret == DISPATCH_TEST_SUCCESS )
|
||||
{
|
||||
if( test_info.failed == 0 )
|
||||
if( test_info.result == TEST_RESULT_SUCCESS )
|
||||
{
|
||||
mbedtls_fprintf( stdout, "PASS\n" );
|
||||
}
|
||||
else if( test_info.result == TEST_RESULT_SKIPPED )
|
||||
{
|
||||
mbedtls_fprintf( stdout, "----\n" );
|
||||
total_skipped++;
|
||||
}
|
||||
else
|
||||
{
|
||||
total_errors++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue