Module: Mesa
Branch: master
Commit: 356be07ce279e6ff2d468fd1321a2edb2d6b2df2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=356be07ce279e6ff2d468fd1321a2edb2d6b2df2

Author: Eric Engestrom <[email protected]>
Date:   Wed Jun  3 21:58:32 2020 +0200

intel/tools: make test aware of the meson test wrapper

Suggested-by: Dylan Baker <[email protected]>
Signed-off-by: Eric Engestrom <[email protected]>
Reviewed-by: Dylan Baker <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5155>

---

 src/intel/tools/tests/run-test.py | 39 ++++++++++++++++++++++++++++++++-------
 1 file changed, 32 insertions(+), 7 deletions(-)

diff --git a/src/intel/tools/tests/run-test.py 
b/src/intel/tools/tests/run-test.py
index 2d1c1a596c1..1dfa305661d 100755
--- a/src/intel/tools/tests/run-test.py
+++ b/src/intel/tools/tests/run-test.py
@@ -2,10 +2,20 @@
 
 import argparse
 import difflib
+import errno
+import os
 import pathlib
 import subprocess
+import sys
 import tempfile
 
+# The meson version handles windows paths better, but if it's not available
+# fall back to shlex
+try:
+    from meson.mesonlib import split_args
+except ImportError:
+    from shlex import split as split_args
+
 parser = argparse.ArgumentParser()
 parser.add_argument('--i965_asm',
                     help='path to i965_asm binary')
@@ -16,6 +26,12 @@ parser.add_argument('--gen_folder',
                     help='name of the folder for the generation')
 args = parser.parse_args()
 
+wrapper = os.environ.get('MESON_EXE_WRAPPER')
+if wrapper is not None:
+    i965_asm = split_args(wrapper) + [args.i965_asm]
+else:
+    i965_asm = [args.i965_asm]
+
 success = True
 
 for asm_file in args.gen_folder.glob('*.asm'):
@@ -23,13 +39,22 @@ for asm_file in args.gen_folder.glob('*.asm'):
     expected_path = args.gen_folder / expected_file
     out_path = tempfile.NamedTemporaryFile()
 
-    subprocess.run([args.i965_asm,
-                    '--type', 'hex',
-                    '--gen', args.gen_name,
-                    '--output', out_path.name,
-                    asm_file],
-                   stdout=subprocess.DEVNULL,
-                   stderr=subprocess.STDOUT)
+    try:
+        command = i965_asm + [
+            '--type', 'hex',
+            '--gen', args.gen_name,
+            '--output', out_path.name,
+            asm_file
+        ]
+        subprocess.run(command,
+                       stdout=subprocess.DEVNULL,
+                       stderr=subprocess.STDOUT)
+    except OSError as e:
+        if e.errno == errno.ENOEXEC:
+            print('Skipping due to inability to run host binaries.',
+                  file=sys.stderr)
+            exit(77)
+        raise
 
     with expected_path.open() as f:
         lines_before = f.readlines()

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to