glsl: give all unnamed structs the same name
[mesa.git] / src / compiler / glsl / tests / optimization-test.sh
index 86a87b0d954a6c60e4cb4382d8c1c15b828a28ba..e54edc7fb01d209f33f4bd49afec81a8a1c91e04 100755 (executable)
@@ -34,17 +34,17 @@ ORIGDIR=`pwd`
 echo "======       Generating tests      ======"
 for dir in $srcdir/glsl/tests/*/; do
     if [ -e "${dir}create_test_cases.py" ]; then
+        echo "$dir"
         # construct the correct builddir
         completedir="$abs_builddir/glsl/tests/`echo ${dir} | sed 's|.*/glsl/tests/||g'`"
         mkdir -p $completedir
         cd $dir;
-        $PYTHON2 create_test_cases.py --outdir $completedir;
+        $PYTHON2 create_test_cases.py --runner $abs_builddir/glsl/glsl_test --outdir $completedir;
         if [ $? -eq 0 ]; then
             has_tests=1
         fi
         cd ..
     fi
-    echo "$dir"
 done
 cd "$ORIGDIR"
 
@@ -60,8 +60,8 @@ fi
 
 echo "====== Testing optimization passes ======"
 for test in `find . -iname '*.opt_test'`; do
-    echo -n "Testing $test..."
-    (cd `dirname "$test"`; ./`basename "$test"`) > "$test.out" 2>&1
+    echo -n "Testing `echo $test| sed 's|.*/glsl/tests/||g'`..."
+    ./$test > "$test.out" 2>&1
     total=$((total+1))
     if $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out" >/dev/null 2>&1; then
         echo "PASS"
@@ -72,6 +72,11 @@ for test in `find . -iname '*.opt_test'`; do
     fi
 done
 
+if [ $total -eq 0 ]; then
+    echo "Could not find any tests."
+    exit 1
+fi
+
 echo ""
 echo "$pass/$total tests returned correct results"
 echo ""