mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
build: Add installed-tests support for mkenums.py
This makes the Meson build code for it a little more generic, and adds support for installed tests. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
3f02660ea5
commit
e3171ee08c
@ -56,6 +56,10 @@ if cc.get_id() != 'msvc'
|
|||||||
gobject_tests += {'autoptr' : {}}
|
gobject_tests += {'autoptr' : {}}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
python_tests = [
|
||||||
|
'mkenums.py',
|
||||||
|
]
|
||||||
|
|
||||||
# FIXME: put common bits of test environment() in one location
|
# FIXME: put common bits of test environment() in one location
|
||||||
# Not entirely random of course, but at least it changes over time
|
# Not entirely random of course, but at least it changes over time
|
||||||
random_number = minor_version + meson.version().split('.').get(1).to_int()
|
random_number = minor_version + meson.version().split('.').get(1).to_int()
|
||||||
@ -106,10 +110,39 @@ foreach test_name, extra_args : gobject_tests
|
|||||||
test(test_name, exe, env : test_env, timeout : timeout, suite : suite)
|
test(test_name, exe, env : test_env, timeout : timeout, suite : suite)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
test(
|
foreach test_name : python_tests
|
||||||
'mkenums.py',
|
test(
|
||||||
python,
|
test_name,
|
||||||
args: files('mkenums.py'),
|
python,
|
||||||
env: test_env,
|
args: files(test_name),
|
||||||
suite: ['gobject'],
|
env: test_env,
|
||||||
)
|
suite: ['gobject'],
|
||||||
|
)
|
||||||
|
|
||||||
|
if installed_tests_enabled
|
||||||
|
install_data(
|
||||||
|
files(test_name),
|
||||||
|
install_dir: installed_tests_execdir,
|
||||||
|
install_mode: 'rwxr-xr-x',
|
||||||
|
)
|
||||||
|
|
||||||
|
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_tap,
|
||||||
|
output: test_name + '.test',
|
||||||
|
install_dir: installed_tests_metadir,
|
||||||
|
configuration: test_conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
# TAP test runner for Python tests
|
||||||
|
if installed_tests_enabled
|
||||||
|
install_data(
|
||||||
|
files('taptestrunner.py'),
|
||||||
|
install_dir: installed_tests_execdir,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user