cogl/tests: Run conform tests as single meson tests
Use find-conform-unit-tests.sh to create a meson list of tests to run. This allows to run each test as single test with meson and to remove the timeout for all the tests. Instead of changing 'run-tests.sh' to take test-names as arguments we can just generate simple dummy test-files for each test, without having to change the tooling. https://gitlab.gnome.org/GNOME/mutter/merge_requests/442
This commit is contained in:
parent
2b8f5e65b6
commit
34312c272b
@ -99,21 +99,36 @@ libmutter_cogl_test_conformance = executable('test-conformance',
|
|||||||
)
|
)
|
||||||
|
|
||||||
find_unit_tests = find_program('meson/find-conform-unit-tests.sh')
|
find_unit_tests = find_program('meson/find-conform-unit-tests.sh')
|
||||||
|
test_conform_main = files(join_paths(meson.current_source_dir(), 'test-conform-main.c'))
|
||||||
cogl_conform_unit_tests = custom_target('cogl-tests-conform-unit-tests',
|
cogl_conform_unit_tests = custom_target('cogl-tests-conform-unit-tests',
|
||||||
output: 'unit-tests',
|
output: 'unit-tests',
|
||||||
input: 'test-conform-main.c',
|
input: test_conform_main,
|
||||||
command: [find_unit_tests, '@INPUT@', '@OUTPUT@'],
|
command: [find_unit_tests, '@INPUT@', '@OUTPUT@'],
|
||||||
install: have_installed_tests,
|
install: have_installed_tests,
|
||||||
install_dir: cogl_installed_tests_libexecdir,
|
install_dir: cogl_installed_tests_libexecdir,
|
||||||
)
|
)
|
||||||
|
|
||||||
test('conform', cogl_run_tests,
|
cogl_conformance_tests = run_command(
|
||||||
suite: ['cogl'],
|
find_unit_tests, test_conform_main, '/dev/stdout',
|
||||||
args: [
|
check: true,
|
||||||
cogl_config_env,
|
).stdout().strip().split('\n')
|
||||||
libmutter_cogl_test_conformance,
|
|
||||||
cogl_conform_unit_tests
|
foreach test_target: cogl_conformance_tests
|
||||||
],
|
name_parts = []
|
||||||
is_parallel: false,
|
foreach part: test_target.split('_')
|
||||||
timeout: 120,
|
if part != 'test'
|
||||||
)
|
name_parts += [part]
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
test_name = '-'.join(name_parts)
|
||||||
|
test(test_name, cogl_run_tests,
|
||||||
|
suite: ['cogl', 'cogl/conform'],
|
||||||
|
args: [
|
||||||
|
cogl_config_env,
|
||||||
|
libmutter_cogl_test_conformance,
|
||||||
|
test_target
|
||||||
|
],
|
||||||
|
is_parallel: false,
|
||||||
|
)
|
||||||
|
endforeach
|
||||||
|
Loading…
Reference in New Issue
Block a user