glib/tests/build: Support setting env variables for python tests

This commit is contained in:
Marco Trevisan (Treviño) 2024-05-09 16:45:46 +02:00
parent 486ad65535
commit aab0ff201b

View File

@ -508,6 +508,11 @@ foreach test_name, extra_args : python_tests
suite += 'failing' suite += 'failing'
endif endif
local_test_env = test_env
foreach var, value : extra_args.get('env', {})
local_test_env.append(var, value)
endforeach
foreach program : extra_args.get('extra_programs', []) foreach program : extra_args.get('extra_programs', [])
depends += test_extra_programs_targets[program] depends += test_extra_programs_targets[program]
endforeach endforeach
@ -518,7 +523,7 @@ foreach test_name, extra_args : python_tests
protocol : extra_args.get('protocol', test_protocol), protocol : extra_args.get('protocol', test_protocol),
depends: depends, depends: depends,
args: ['-B', files(test_name)], args: ['-B', files(test_name)],
env: test_env, env: local_test_env,
suite: suite, suite: suite,
) )