installed tests: Allow tests to set environment variables

It's necessary sometimes for installed tests to be able to run with a
custom environment. For example, the gsocketclient-slow test requires an
LD_PRELOADed library to provide a slow connect() (this is to be added in
a followup commit).

Introduce a variable `@env@` into the installed test template, which we
can override as necessary when generating `.test` files, to run tests
prefixed with `/usr/bin/env <LIST OF VARIABLES>`.

As the only test that requires this currently lives in `gio/tests/`, we
are only hooking this up for that directory right now. If other tests in
future require this treatment, then the support can be extended at that
point.
This commit is contained in:
Iain Lane
2019-02-12 11:29:10 +00:00
parent f773b3533a
commit 07a1a8031d
8 changed files with 19 additions and 1 deletions

View File

@@ -36,6 +36,7 @@ foreach test_name, extra_args : refcount_tests
test_conf = configuration_data()
test_conf.set('installed_tests_dir', installed_tests_execdir)
test_conf.set('program', test_name)
test_conf.set('env', '')
configure_file(
input: installed_tests_template,
output: test_name + '.test',