[Piglit] [PATCH 1/3] all.py: check if running in cygwin, use Windows-style path for testsDir

Brian Paul brianp at vmware.com
Tue Jun 3 07:57:55 PDT 2014

Otherwise, the file path we're passing to programs such as shader_runner
is in Unix style, which Windows programs don't understand.

v2: use subprocess module instead of commands module, per Dylan
 tests/all.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/all.py b/tests/all.py
index a42e79e..aae0f54 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -7,7 +7,8 @@ import itertools
 import os
 import os.path as path
 import platform
-import shlex
+import subprocess
+import sys
 from framework.profile import TestProfile
 from framework.exectest import PiglitTest
@@ -17,6 +18,10 @@ from framework.shader_test import add_shader_test_dir
 # Path to tests dir, correct even when not running from the top directory.
 testsDir = path.dirname(__file__)
+if sys.platform == "cygwin":
+    # convert the path to DOS style so it's parsable by shader_runner, etc.
+    testsDir = subprocess.check_output(['cygpath', '-d', testsDir])
+    testsDir = testsDir.replace('\n', '')  # remove trailing newline
 # Find the generated_tests directory, by looking either in
 # $PIGLIT_BUILD_DIR (if that environment variable exists) or in the

More information about the Piglit mailing list