mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-06-06 05:25:18 +00:00
Generate static test functions & wrappers to fix missing-prototype errors in mbedtls/tests/suites
Required for: https://github.com/Mbed-TLS/mbedtls/pull/9189 Signed-off-by: Michael Schuster <michael@schuster.ms>
This commit is contained in:
@@ -328,7 +328,7 @@ def gen_function_wrapper(name, local_vars, args_dispatch):
|
||||
"""
|
||||
# Then create the wrapper
|
||||
wrapper = '''
|
||||
void {name}_wrapper( void ** params )
|
||||
static void {name}_wrapper( void ** params )
|
||||
{{
|
||||
{unused_params}{locals}
|
||||
{name}( {args} );
|
||||
@@ -651,6 +651,9 @@ def parse_function_code(funcs_f, dependencies, suite_dependencies):
|
||||
raise GeneratorInputError("file: %s - Test functions not found!" %
|
||||
funcs_f.name)
|
||||
|
||||
# Make the test function static
|
||||
code = code.replace('void', 'static void', 1)
|
||||
|
||||
# Prefix test function name with 'test_'
|
||||
code = code.replace(name, 'test_' + name, 1)
|
||||
name = 'test_' + name
|
||||
|
||||
Reference in New Issue
Block a user