[mutter] tests/cogl/unit: Run most tests with all drivers



commit 2c7203266884cbcab75eaf672c7b365f81843995
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Fri Aug 5 11:31:14 2022 +0200

    tests/cogl/unit: Run most tests with all drivers
    
    All tests but one (so far) will in one way or the other depend on what
    driver is used, so run the tests on all.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>

 src/tests/cogl/unit/meson.build | 35 ++++++++++++++++++++++++-----------
 1 file changed, 24 insertions(+), 11 deletions(-)
---
diff --git a/src/tests/cogl/unit/meson.build b/src/tests/cogl/unit/meson.build
index 16a8169e93..2a3216bee1 100644
--- a/src/tests/cogl/unit/meson.build
+++ b/src/tests/cogl/unit/meson.build
@@ -1,9 +1,12 @@
+all_variants = ['gl', 'gl3', 'gles2']
+any_variant = ['any']
+
 cogl_unit_tests = [
-  ['test-bitmask', true],
-  ['test-pipeline-cache', true],
-  ['test-pipeline-state-known-failure', false],
-  ['test-pipeline-state', true],
-  ['test-pipeline-glsl', true],
+  ['test-bitmask', true, any_variant],
+  ['test-pipeline-cache', true, all_variants],
+  ['test-pipeline-state-known-failure', false, all_variants],
+  ['test-pipeline-state', true, all_variants],
+  ['test-pipeline-glsl', true, all_variants],
 ]
 
 test_env = environment()
@@ -15,6 +18,7 @@ test_env.set('MUTTER_TEST_PLUGIN_PATH', '@0@'.format(default_plugin.full_path())
 foreach unit_test: cogl_unit_tests
   test_name = 'cogl-' + unit_test[0]
   should_pass = unit_test[1]
+  variants = unit_test[2]
 
   test_executable = executable(test_name,
     sources: [
@@ -36,10 +40,19 @@ foreach unit_test: cogl_unit_tests
     ],
   )
 
-  test(test_name, test_executable,
-    suite: ['cogl', 'cogl/unit'],
-    env: test_env,
-    is_parallel: false,
-    should_fail: not should_pass,
-  )
+  foreach variant: variants
+    if variant == 'any'
+      variant_test_env = test_env
+    else
+      variant_test_env = test_env
+      variant_test_env.set('COGL_DRIVER', variant)
+    endif
+
+    test('@0@-@1@'.format(test_name, variant), test_executable,
+      suite: ['cogl', 'cogl/unit'],
+      env: variant_test_env,
+      is_parallel: false,
+      should_fail: not should_pass,
+    )
+  endforeach
 endforeach


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