From 34312c272bd9872963342d14d15416757aff8815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 13 Feb 2019 10:34:07 -0500 Subject: [PATCH] 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 --- cogl/tests/conform/meson.build | 37 ++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/cogl/tests/conform/meson.build b/cogl/tests/conform/meson.build index de2d2fa4b..9a94eba51 100644 --- a/cogl/tests/conform/meson.build +++ b/cogl/tests/conform/meson.build @@ -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