summaryrefslogtreecommitdiff
path: root/test/meson.build
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-06-24 13:01:54 +0100
committerSimon McVittie <smcv@collabora.com>2022-07-13 20:36:13 +0100
commite75d8a7cbc98c13a1e75360e7ea6a36123ad849d (patch)
treeeb96b830db13c68cdcf730fff97dba2cfeac9845 /test/meson.build
parentc8ecf552c8cce8219912918a625bc6346d470a71 (diff)
downloaddbus-e75d8a7cbc98c13a1e75360e7ea6a36123ad849d.tar.gz
test: Correct generation of .test metadata
If a helper executable is not, in itself, a test-case, then we should not generate metadata that tells ginsttest-runner to run it as a test-case. Meanwhile, we were previously generating foo_with_config.test metadata for tests that don't get installed; stop doing that. We also need to distinguish between the abstract name of the test (which usually does not start with test-), the name of the .test file (which does start with test- for compiled executables), and the name of the executable (which may include .exe as well). To make validation against the Autotools build system as straightforward as possible, generate exactly the same names as in Autotools. We can consider removing the test- prefix later, if we remove the Autotools build system. Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'test/meson.build')
-rw-r--r--test/meson.build25
1 files changed, 19 insertions, 6 deletions
diff --git a/test/meson.build b/test/meson.build
index fa2338cc..42370715 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -85,6 +85,8 @@ xdgdir = custom_target('gen-xdgdir',
output: 'XDG_RUNTIME_DIR'
)
+installed_tests = []
+
###############################################################################
# Dbus testutils
@@ -536,6 +538,13 @@ foreach test: tests
timeout: timeout,
)
endif
+
+ if install and test.get('test', true)
+ installed_tests += [{
+ 'name': 'test-' + test.get('name'),
+ 'exe': 'test-' + test.get('name') + exe_ext,
+ }]
+ endif
endforeach
@@ -573,6 +582,10 @@ foreach script: scripts
install_mode: 'rwxr-xr-x',
install_dir: test_exec_dir,
)
+ installed_tests += [{
+ 'name': name,
+ 'exe': name,
+ }]
endif
# Some scripts might be used in tests but not themselves tests,
@@ -588,27 +601,27 @@ foreach script: scripts
endforeach
-foreach exe : scripts + tests
- name = exe.get('name')
- install = exe.get('install', true)
+foreach test_case: installed_tests
+ name = test_case.get('name')
+ exe = test_case.get('exe', name)
meta_config = configuration_data()
meta_config.set('command',
'env @0@/@1@ --tap'.format(
- get_option('prefix') / test_exec_dir, name
+ get_option('prefix') / test_exec_dir, exe,
))
configure_file(
input : 'meta_template.test.in',
output: name + '.test',
configuration: meta_config,
- install: install_tests and install,
+ install: install_tests,
install_dir: test_meta_dir
)
meta_config = configuration_data()
meta_config.set('command',
'env DBUS_TEST_EXEC=@0@ DBUS_TEST_DATA=@0@/data @0@/@1@ --tap'.format(
- get_option('prefix') / test_exec_dir, name
+ get_option('prefix') / test_exec_dir, exe,
))
configure_file(
input : 'meta_template.test.in',