Mesa (main): meson/glsl: Only run GLSL tests if can_run_host_binaries()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 12 00:22:57 UTC 2021


Module: Mesa
Branch: main
Commit: a4d1ae7017aa3d5c0b8d85150fdb17edc5a56ca6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a4d1ae7017aa3d5c0b8d85150fdb17edc5a56ca6

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Tue Aug 10 21:05:30 2021 -0500

meson/glsl: Only run GLSL tests if can_run_host_binaries()

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>
Reviewed-by: Eric Engestrom <eric at engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12308>

---

 src/compiler/glsl/glcpp/meson.build |  8 +++++-
 src/compiler/glsl/tests/meson.build | 50 +++++++++++++++++++++----------------
 2 files changed, 35 insertions(+), 23 deletions(-)

diff --git a/src/compiler/glsl/glcpp/meson.build b/src/compiler/glsl/glcpp/meson.build
index 0c67d1fa741..4614310aee1 100644
--- a/src/compiler/glsl/glcpp/meson.build
+++ b/src/compiler/glsl/glcpp/meson.build
@@ -89,8 +89,14 @@ glcpp = executable(
   build_by_default : false,
 )
 
+# Meson can't auto-skip these on cross builds because of the python wrapper
+#
+# TODO: has_exe_wrapper() is deprecated and renamed to can_run_host_binaries()
+# starting with Meson 0.55.0
+#
 # FIXME: these fail on windows due to whitespace differences
-if with_any_opengl and with_tests and host_machine.system() != 'windows'
+if with_any_opengl and with_tests and meson.has_exe_wrapper() and \
+   host_machine.system() != 'windows'
   modes = ['unix', 'windows', 'oldmac', 'bizarro']
 
   foreach m : modes
diff --git a/src/compiler/glsl/tests/meson.build b/src/compiler/glsl/tests/meson.build
index 17945382db4..c8a84a81801 100644
--- a/src/compiler/glsl/tests/meson.build
+++ b/src/compiler/glsl/tests/meson.build
@@ -79,29 +79,35 @@ test(
   suite : ['compiler', 'glsl'],
 )
 
-test(
-  'glsl compiler warnings',
-  prog_python,
-  args : [
-    join_paths(meson.current_source_dir(), 'warnings_test.py'),
-    '--glsl-compiler', glsl_compiler,
-    '--test-directory', join_paths(
-      meson.source_root(), 'src', 'compiler', 'glsl', 'tests', 'warnings'
-    ),
-  ],
-  suite : ['compiler', 'glsl'],
-  timeout: 60,
-)
+# Meson can't auto-skip these on cross builds because of the python wrapper
+#
+# TODO: has_exe_wrapper() is deprecated and renamed to can_run_host_binaries()
+# starting with Meson 0.55.0
+if meson.has_exe_wrapper()
+  test(
+    'glsl compiler warnings',
+    prog_python,
+    args : [
+      join_paths(meson.current_source_dir(), 'warnings_test.py'),
+      '--glsl-compiler', glsl_compiler,
+      '--test-directory', join_paths(
+        meson.source_root(), 'src', 'compiler', 'glsl', 'tests', 'warnings'
+      ),
+    ],
+    suite : ['compiler', 'glsl'],
+    timeout: 60,
+  )
 
-test(
-  'glsl optimization',
-  prog_python,
-  args : [
-    join_paths(meson.current_source_dir(), 'optimization_test.py'),
-    '--test-runner', glsl_test
-  ],
-  suite : ['compiler', 'glsl'],
-)
+  test(
+    'glsl optimization',
+    prog_python,
+    args : [
+      join_paths(meson.current_source_dir(), 'optimization_test.py'),
+      '--test-runner', glsl_test
+    ],
+    suite : ['compiler', 'glsl'],
+  )
+endif
 
 if with_tools.contains('glsl')
   test(



More information about the mesa-commit mailing list