Skip to content

Commit

Permalink
Generate static test functions & wrappers to fix missing-prototype er…
Browse files Browse the repository at this point in the history
…rors in mbedtls/tests/suites

Required for: Mbed-TLS/mbedtls#9189

Signed-off-by: Michael Schuster <michael@schuster.ms>
  • Loading branch information
misch7 committed Jun 5, 2024
1 parent 623c1b4 commit 852d0c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/generate_test_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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} );
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 852d0c0

Please sign in to comment.