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

Submitted by Iago Toral Quiroga on Oct. 1, 2014, 6:35 a.m.

Details

Message ID 1412145345-3974-2-git-send-email-itoral@igalia.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Iago Toral Quiroga Oct. 1, 2014, 6:35 a.m.
From: Petri Latvala <petri.latvala@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@intel.com>
Acked-by: Connor Abbott <cwabbott0@gmail.com>
---
 src/glsl/tests/optimization-test | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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