[mutter] cogl/tests: Run conform tests as single meson tests



commit 34312c272bd9872963342d14d15416757aff8815
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Wed Feb 13 10:34:07 2019 -0500

    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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]