[Mesa-dev] [PATCH v2 1/9] glsl: Fix directory handling in optimization-test

Iago Toral Quiroga itoral at igalia.com
Tue Sep 30 23:35:37 PDT 2014


From: Petri Latvala <petri.latvala at intel.com>

optimization-test loops over directories that contain a file named
create_test_cases.py. For each occurrence, it enters the directory
that contains the file and executes it, and is then supposed to return
to the previous directory.

The name .. was hardcoded in the script, and should be
../.. instead. Hardcoding that is finicky too, so wrap the directory change
and script execution in a subshell instead.

In case of errors executing create_test_cases.py, exit with status 1
to make the test run communicate failure properly.

Signed-off-by: Petri Latvala <petri.latvala at intel.com>
Acked-by: Connor Abbott <cwabbott0 at gmail.com>
---
 src/glsl/tests/optimization-test | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glsl/tests/optimization-test b/src/glsl/tests/optimization-test
index 26a51be..12ecc5e 100755
--- a/src/glsl/tests/optimization-test
+++ b/src/glsl/tests/optimization-test
@@ -12,7 +12,7 @@ pass=0
 echo "======       Generating tests      ======"
 for dir in tests/*/; do
     if [ -e "${dir}create_test_cases.py" ]; then
-        cd $dir; $PYTHON2 create_test_cases.py; cd ..
+        (cd $dir; $PYTHON2 create_test_cases.py) || exit 1
     fi
     echo "$dir"
 done
-- 
1.9.1



More information about the mesa-dev mailing list