mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-12-24 17:41:01 +03:00
Auto add 'exit' label in every test function. Failed assert now goes there
This commit is contained in:
@@ -86,7 +86,7 @@ while($test_cases =~ /\/\* BEGIN_CASE *([\w:]*) \*\/\n(.*?)\n\/\* END_CASE \*\//
|
||||
{
|
||||
die "Test function does not have 'void' as return type\n";
|
||||
}
|
||||
if ($function_decl !~ /^void (\w+)\(\s*(.*?)\s*\)\s*{(.*?)}/ms)
|
||||
if ($function_decl !~ /^void (\w+)\(\s*(.*?)\s*\)\s*{(.*)}/ms)
|
||||
{
|
||||
die "Function declaration not in expected format\n";
|
||||
}
|
||||
@@ -104,6 +104,12 @@ while($test_cases =~ /\/\* BEGIN_CASE *([\w:]*) \*\/\n(.*?)\n\/\* END_CASE \*\//
|
||||
|
||||
$function_decl =~ s/^void /void test_suite_/;
|
||||
|
||||
# Add exit label if not present
|
||||
if ($function_decl !~ /^exit:$/m)
|
||||
{
|
||||
$function_decl =~ s/}\s*$/\nexit:\n return;\n}/;
|
||||
}
|
||||
|
||||
if ($function_deps =~ /^depends_on:/)
|
||||
{
|
||||
( $function_deps ) = $function_deps =~ /^depends_on:(.*)$/;
|
||||
|
||||
Reference in New Issue
Block a user