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:
Marco Trevisan (Treviño) 2019-02-13 10:34:07 -05:00 committed by Marco Trevisan
parent 2b8f5e65b6
commit 34312c272b

View File

@ -99,21 +99,36 @@ libmutter_cogl_test_conformance = executable('test-conformance',
)
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',
output: 'unit-tests',
input: 'test-conform-main.c',
input: test_conform_main,
command: [find_unit_tests, '@INPUT@', '@OUTPUT@'],
install: have_installed_tests,
install_dir: cogl_installed_tests_libexecdir,
)
test('conform', cogl_run_tests,
suite: ['cogl'],
args: [
cogl_config_env,
libmutter_cogl_test_conformance,
cogl_conform_unit_tests
],
is_parallel: false,
timeout: 120,
)
cogl_conformance_tests = run_command(
find_unit_tests, test_conform_main, '/dev/stdout',
check: true,
).stdout().strip().split('\n')
foreach test_target: cogl_conformance_tests
name_parts = []
foreach part: test_target.split('_')
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