From 7473fcd40b5d105eac9592dabc88f8757555cfc9 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Wed, 22 Feb 2017 15:53:21 +0000 Subject: glsl/tests: suffix .sh/.py files as applicable This makes it easier/clearer as to: - if the file should have the execute bit set (.py should not) - do we need the shebang in the first place and if so what it should be Signed-off-by: Emil Velikov Reviewed-by: Eric Engestrom --- src/compiler/Makefile.glsl.am | 8 +- src/compiler/glsl/glcpp/tests/glcpp-test | 110 ----------------- src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf | 141 ---------------------- src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf.sh | 141 ++++++++++++++++++++++ src/compiler/glsl/glcpp/tests/glcpp-test.sh | 110 +++++++++++++++++ src/compiler/glsl/tests/compare_ir | 59 --------- src/compiler/glsl/tests/compare_ir.py | 59 +++++++++ src/compiler/glsl/tests/optimization-test | 42 ------- src/compiler/glsl/tests/optimization-test.sh | 42 +++++++ src/compiler/glsl/tests/warnings-test | 31 ----- src/compiler/glsl/tests/warnings-test.sh | 31 +++++ 11 files changed, 387 insertions(+), 387 deletions(-) delete mode 100755 src/compiler/glsl/glcpp/tests/glcpp-test delete mode 100755 src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf create mode 100755 src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf.sh create mode 100755 src/compiler/glsl/glcpp/tests/glcpp-test.sh delete mode 100755 src/compiler/glsl/tests/compare_ir create mode 100755 src/compiler/glsl/tests/compare_ir.py delete mode 100755 src/compiler/glsl/tests/optimization-test create mode 100755 src/compiler/glsl/tests/optimization-test.sh delete mode 100755 src/compiler/glsl/tests/warnings-test create mode 100755 src/compiler/glsl/tests/warnings-test.sh diff --git a/src/compiler/Makefile.glsl.am b/src/compiler/Makefile.glsl.am index 41edb3cf4d9..f7be5ebce9d 100644 --- a/src/compiler/Makefile.glsl.am +++ b/src/compiler/Makefile.glsl.am @@ -30,15 +30,15 @@ EXTRA_DIST += glsl/tests glsl/glcpp/tests glsl/README \ glsl/glcpp/glcpp-parse.y \ SConscript.glsl -TESTS += glsl/glcpp/tests/glcpp-test \ - glsl/glcpp/tests/glcpp-test-cr-lf \ +TESTS += glsl/glcpp/tests/glcpp-test.sh \ + glsl/glcpp/tests/glcpp-test-cr-lf.sh \ glsl/tests/blob-test \ glsl/tests/cache-test \ glsl/tests/general-ir-test \ - glsl/tests/optimization-test \ + glsl/tests/optimization-test.sh \ glsl/tests/sampler-types-test \ glsl/tests/uniform-initializer-test \ - glsl/tests/warnings-test + glsl/tests/warnings-test.sh TESTS_ENVIRONMENT= \ export PYTHON2=$(PYTHON2); \ diff --git a/src/compiler/glsl/glcpp/tests/glcpp-test b/src/compiler/glsl/glcpp/tests/glcpp-test deleted file mode 100755 index 3945ee4f6ce..00000000000 --- a/src/compiler/glsl/glcpp/tests/glcpp-test +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/sh - -if [ ! -z "$srcdir" ]; then - testdir=$srcdir/glsl/glcpp/tests - outdir=`pwd`/glsl/glcpp/tests - glcpp=`pwd`/glsl/glcpp/glcpp -else - testdir=. - outdir=. - glcpp=../glcpp -fi - -trap 'rm $test.valgrind-errors; exit 1' INT QUIT - -usage () -{ - cat < Use tests in the given (default is ".") - --valgrind Run the test suite a second time under valgrind -EOF -} - -test_specific_args () -{ - test="$1" - - tr "\r" "\n" < "$test" | grep 'glcpp-args:' | sed -e 's,^.*glcpp-args: *,,' -} - -# Parse command-line options -for option; do - case "${option}" in - "--help") - usage - exit 0 - ;; - "--valgrind") - do_valgrind=yes - ;; - "--testdir="*) - testdir="${option#--testdir=}" - outdir="${outdir}/${option#--testdir=}" - ;; - *) - echo "Unrecognized option: $option" >&2 - echo >&2 - usage - exit 1 - ;; - esac -done - -total=0 -pass=0 -clean=0 - -mkdir -p $outdir - -echo "====== Testing for correctness ======" -for test in $testdir/*.c; do - out=$outdir/${test##*/}.out - - printf "Testing $test... > $out ($test.expected) " - $glcpp $(test_specific_args $test) < $test > $out 2>&1 - total=$((total+1)) - if cmp $test.expected $out >/dev/null 2>&1; then - echo "PASS" - pass=$((pass+1)) - else - echo "FAIL" - diff -u $test.expected $out - fi -done - -echo "" -echo "$pass/$total tests returned correct results" -echo "" - -if [ "$do_valgrind" = "yes" ]; then - echo "====== Testing for valgrind cleanliness ======" - for test in $testdir/*.c; do - printf "Testing $test with valgrind..." - valgrind --error-exitcode=31 --log-file=$test.valgrind-errors $glcpp $(test_specific_args $test) < $test >/dev/null 2>&1 - if [ "$?" = "31" ]; then - echo "ERRORS" - cat $test.valgrind-errors - else - echo "CLEAN" - clean=$((clean+1)) - rm $test.valgrind-errors - fi - done - - echo "" - echo "$pass/$total tests returned correct results" - echo "$clean/$total tests are valgrind-clean" -fi - -if [ "$pass" = "$total" ] && [ "$do_valgrind" != "yes" ] || [ "$pass" = "$total" ]; then - exit 0 -else - exit 1 -fi - diff --git a/src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf b/src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf deleted file mode 100755 index c75370f48c3..00000000000 --- a/src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/sh - -# The build system runs this test from a different working directory, and may -# be in a build directory entirely separate from the source. So if the -# "srcdir" variable is set, we must use it to locate the test files and the -# glcpp-test script. - -if [ ! -z "$srcdir" ]; then - testdir="$srcdir/glsl/glcpp/tests" - glcpp_test="$srcdir/glsl/glcpp/tests/glcpp-test" -else - testdir=. - glcpp_test=./glcpp-test -fi - -total=0 -pass=0 - -# This supports a pipe that doesn't destroy the exit status of first command -# -# http://unix.stackexchange.com/questions/14270/get-exit-status-of-process-thats-piped-to-another -stdintoexitstatus() { - read exitstatus - return $exitstatus -} - -run_test () -{ - cmd="$1" - - total=$((total+1)) - - if [ "$VERBOSE" = "yes" ]; then - if $cmd; then - echo "PASS" - pass=$((pass+1)) - else - echo "FAIL" - fi - else - # This is "$cmd | tail -2" but with the exit status of "$cmd" not "tail -2" - if (((($cmd; echo $? >&3) | tail -2 | head -1 >&4) 3>&1) | stdintoexitstatus) 4>&1; then - echo "PASS" - pass=$((pass+1)) - else - echo "FAIL" - fi - fi -} - -usage () -{ - cat <&2 - echo >&2 - usage - exit 1 - ;; - esac -done - -# All tests depend on the .out files being present. So first do a -# normal run of the test suite, (silently) just to create the .out -# files as a side effect. -rm -rf ./subtest-lf -mkdir subtest-lf -for file in "$testdir"/*.c; do - base=$(basename "$file") - cp "$file" subtest-lf -done - -${glcpp_test} --testdir=subtest-lf >/dev/null 2>&1 - -echo "===== Testing with \\\\r line terminators (old Mac format) =====" - -# Prepare test files with '\r' instead of '\n' -rm -rf ./subtest-cr -mkdir subtest-cr -for file in "$testdir"/*.c; do - base=$(basename "$file") - tr "\n" "\r" < "$file" > subtest-cr/"$base" - cp `pwd`/glsl/glcpp/tests/subtest-lf/"$base".out subtest-cr/"$base".expected -done - -run_test "${glcpp_test} --testdir=subtest-cr" - -echo "===== Testing with \\\\r\\\\n line terminators (DOS format) =====" - -# Prepare test files with '\r\n' instead of '\n' -rm -rf ./subtest-cr-lf -mkdir subtest-cr-lf -for file in "$testdir"/*.c; do - base=$(basename "$file") - sed -e 's/$/ /' < "$file" > subtest-cr-lf/"$base" - cp `pwd`/glsl/glcpp/tests/subtest-lf/"$base".out subtest-cr-lf/"$base".expected -done - -run_test "${glcpp_test} --testdir=subtest-cr-lf" - -echo "===== Testing with \\\\n\\\\r (bizarre, but allowed by GLSL spec.) =====" - -# Prepare test files with '\n\r' instead of '\n' -rm -rf ./subtest-lf-cr -mkdir subtest-lf-cr -for file in "$testdir"/*.c; do - base=$(basename "$file") - sed -e 's/$/ /' < "$file" | tr "\n\r" "\r\n" > subtest-lf-cr/"$base" - cp `pwd`/glsl/glcpp/tests/subtest-lf/"$base".out subtest-lf-cr/"$base".expected -done - -run_test "${glcpp_test} --testdir=subtest-lf-cr" - -echo "" -echo "$pass/$total tests returned correct results" -echo "" - -if [ "$pass" = "$total" ]; then - exit 0 -else - exit 1 -fi diff --git a/src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf.sh b/src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf.sh new file mode 100755 index 00000000000..c0ed9e04bc6 --- /dev/null +++ b/src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf.sh @@ -0,0 +1,141 @@ +#!/bin/sh + +# The build system runs this test from a different working directory, and may +# be in a build directory entirely separate from the source. So if the +# "srcdir" variable is set, we must use it to locate the test files and the +# glcpp-test script. + +if [ ! -z "$srcdir" ]; then + testdir="$srcdir/glsl/glcpp/tests" + glcpp_test="$srcdir/glsl/glcpp/tests/glcpp-test.sh" +else + testdir=. + glcpp_test=./glcpp-test.sh +fi + +total=0 +pass=0 + +# This supports a pipe that doesn't destroy the exit status of first command +# +# http://unix.stackexchange.com/questions/14270/get-exit-status-of-process-thats-piped-to-another +stdintoexitstatus() { + read exitstatus + return $exitstatus +} + +run_test () +{ + cmd="$1" + + total=$((total+1)) + + if [ "$VERBOSE" = "yes" ]; then + if $cmd; then + echo "PASS" + pass=$((pass+1)) + else + echo "FAIL" + fi + else + # This is "$cmd | tail -2" but with the exit status of "$cmd" not "tail -2" + if (((($cmd; echo $? >&3) | tail -2 | head -1 >&4) 3>&1) | stdintoexitstatus) 4>&1; then + echo "PASS" + pass=$((pass+1)) + else + echo "FAIL" + fi + fi +} + +usage () +{ + cat <&2 + echo >&2 + usage + exit 1 + ;; + esac +done + +# All tests depend on the .out files being present. So first do a +# normal run of the test suite, (silently) just to create the .out +# files as a side effect. +rm -rf ./subtest-lf +mkdir subtest-lf +for file in "$testdir"/*.c; do + base=$(basename "$file") + cp "$file" subtest-lf +done + +${glcpp_test} --testdir=subtest-lf >/dev/null 2>&1 + +echo "===== Testing with \\\\r line terminators (old Mac format) =====" + +# Prepare test files with '\r' instead of '\n' +rm -rf ./subtest-cr +mkdir subtest-cr +for file in "$testdir"/*.c; do + base=$(basename "$file") + tr "\n" "\r" < "$file" > subtest-cr/"$base" + cp `pwd`/glsl/glcpp/tests/subtest-lf/"$base".out subtest-cr/"$base".expected +done + +run_test "${glcpp_test} --testdir=subtest-cr" + +echo "===== Testing with \\\\r\\\\n line terminators (DOS format) =====" + +# Prepare test files with '\r\n' instead of '\n' +rm -rf ./subtest-cr-lf +mkdir subtest-cr-lf +for file in "$testdir"/*.c; do + base=$(basename "$file") + sed -e 's/$/ /' < "$file" > subtest-cr-lf/"$base" + cp `pwd`/glsl/glcpp/tests/subtest-lf/"$base".out subtest-cr-lf/"$base".expected +done + +run_test "${glcpp_test} --testdir=subtest-cr-lf" + +echo "===== Testing with \\\\n\\\\r (bizarre, but allowed by GLSL spec.) =====" + +# Prepare test files with '\n\r' instead of '\n' +rm -rf ./subtest-lf-cr +mkdir subtest-lf-cr +for file in "$testdir"/*.c; do + base=$(basename "$file") + sed -e 's/$/ /' < "$file" | tr "\n\r" "\r\n" > subtest-lf-cr/"$base" + cp `pwd`/glsl/glcpp/tests/subtest-lf/"$base".out subtest-lf-cr/"$base".expected +done + +run_test "${glcpp_test} --testdir=subtest-lf-cr" + +echo "" +echo "$pass/$total tests returned correct results" +echo "" + +if [ "$pass" = "$total" ]; then + exit 0 +else + exit 1 +fi diff --git a/src/compiler/glsl/glcpp/tests/glcpp-test.sh b/src/compiler/glsl/glcpp/tests/glcpp-test.sh new file mode 100755 index 00000000000..3945ee4f6ce --- /dev/null +++ b/src/compiler/glsl/glcpp/tests/glcpp-test.sh @@ -0,0 +1,110 @@ +#!/bin/sh + +if [ ! -z "$srcdir" ]; then + testdir=$srcdir/glsl/glcpp/tests + outdir=`pwd`/glsl/glcpp/tests + glcpp=`pwd`/glsl/glcpp/glcpp +else + testdir=. + outdir=. + glcpp=../glcpp +fi + +trap 'rm $test.valgrind-errors; exit 1' INT QUIT + +usage () +{ + cat < Use tests in the given (default is ".") + --valgrind Run the test suite a second time under valgrind +EOF +} + +test_specific_args () +{ + test="$1" + + tr "\r" "\n" < "$test" | grep 'glcpp-args:' | sed -e 's,^.*glcpp-args: *,,' +} + +# Parse command-line options +for option; do + case "${option}" in + "--help") + usage + exit 0 + ;; + "--valgrind") + do_valgrind=yes + ;; + "--testdir="*) + testdir="${option#--testdir=}" + outdir="${outdir}/${option#--testdir=}" + ;; + *) + echo "Unrecognized option: $option" >&2 + echo >&2 + usage + exit 1 + ;; + esac +done + +total=0 +pass=0 +clean=0 + +mkdir -p $outdir + +echo "====== Testing for correctness ======" +for test in $testdir/*.c; do + out=$outdir/${test##*/}.out + + printf "Testing $test... > $out ($test.expected) " + $glcpp $(test_specific_args $test) < $test > $out 2>&1 + total=$((total+1)) + if cmp $test.expected $out >/dev/null 2>&1; then + echo "PASS" + pass=$((pass+1)) + else + echo "FAIL" + diff -u $test.expected $out + fi +done + +echo "" +echo "$pass/$total tests returned correct results" +echo "" + +if [ "$do_valgrind" = "yes" ]; then + echo "====== Testing for valgrind cleanliness ======" + for test in $testdir/*.c; do + printf "Testing $test with valgrind..." + valgrind --error-exitcode=31 --log-file=$test.valgrind-errors $glcpp $(test_specific_args $test) < $test >/dev/null 2>&1 + if [ "$?" = "31" ]; then + echo "ERRORS" + cat $test.valgrind-errors + else + echo "CLEAN" + clean=$((clean+1)) + rm $test.valgrind-errors + fi + done + + echo "" + echo "$pass/$total tests returned correct results" + echo "$clean/$total tests are valgrind-clean" +fi + +if [ "$pass" = "$total" ] && [ "$do_valgrind" != "yes" ] || [ "$pass" = "$total" ]; then + exit 0 +else + exit 1 +fi + diff --git a/src/compiler/glsl/tests/compare_ir b/src/compiler/glsl/tests/compare_ir deleted file mode 100755 index a40fc810cf3..00000000000 --- a/src/compiler/glsl/tests/compare_ir +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -# coding=utf-8 -# -# Copyright © 2011 Intel Corporation -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -# Compare two files containing IR code. Ignore formatting differences -# and declaration order. - -import os -import os.path -import subprocess -import sys -import tempfile - -from sexps import * - -if len(sys.argv) != 3: - print 'Usage: compare_ir ' - exit(1) - -with open(sys.argv[1]) as f: - ir1 = sort_decls(parse_sexp(f.read())) -with open(sys.argv[2]) as f: - ir2 = sort_decls(parse_sexp(f.read())) - -if ir1 == ir2: - exit(0) -else: - file1, path1 = tempfile.mkstemp(os.path.basename(sys.argv[1])) - file2, path2 = tempfile.mkstemp(os.path.basename(sys.argv[2])) - try: - os.write(file1, '{0}\n'.format(sexp_to_string(ir1))) - os.close(file1) - os.write(file2, '{0}\n'.format(sexp_to_string(ir2))) - os.close(file2) - subprocess.call(['diff', '-u', path1, path2]) - finally: - os.remove(path1) - os.remove(path2) - exit(1) diff --git a/src/compiler/glsl/tests/compare_ir.py b/src/compiler/glsl/tests/compare_ir.py new file mode 100755 index 00000000000..53207dd2ccb --- /dev/null +++ b/src/compiler/glsl/tests/compare_ir.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# coding=utf-8 +# +# Copyright © 2011 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +# Compare two files containing IR code. Ignore formatting differences +# and declaration order. + +import os +import os.path +import subprocess +import sys +import tempfile + +from sexps import * + +if len(sys.argv) != 3: + print 'Usage: python2 ./compare_ir.py ' + exit(1) + +with open(sys.argv[1]) as f: + ir1 = sort_decls(parse_sexp(f.read())) +with open(sys.argv[2]) as f: + ir2 = sort_decls(parse_sexp(f.read())) + +if ir1 == ir2: + exit(0) +else: + file1, path1 = tempfile.mkstemp(os.path.basename(sys.argv[1])) + file2, path2 = tempfile.mkstemp(os.path.basename(sys.argv[2])) + try: + os.write(file1, '{0}\n'.format(sexp_to_string(ir1))) + os.close(file1) + os.write(file2, '{0}\n'.format(sexp_to_string(ir2))) + os.close(file2) + subprocess.call(['diff', '-u', path1, path2]) + finally: + os.remove(path1) + os.remove(path2) + exit(1) diff --git a/src/compiler/glsl/tests/optimization-test b/src/compiler/glsl/tests/optimization-test deleted file mode 100755 index 26a51be6980..00000000000 --- a/src/compiler/glsl/tests/optimization-test +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash - -if [ ! -z "$srcdir" ]; then - compare_ir=`pwd`/tests/compare_ir -else - compare_ir=./compare_ir -fi - -total=0 -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 .. - fi - echo "$dir" -done - -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 - total=$((total+1)) - if $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out" >/dev/null 2>&1; then - echo "PASS" - pass=$((pass+1)) - else - echo "FAIL" - $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out" - fi -done - -echo "" -echo "$pass/$total tests returned correct results" -echo "" - -if [[ $pass == $total ]]; then - exit 0 -else - exit 1 -fi diff --git a/src/compiler/glsl/tests/optimization-test.sh b/src/compiler/glsl/tests/optimization-test.sh new file mode 100755 index 00000000000..9cc3cae3a35 --- /dev/null +++ b/src/compiler/glsl/tests/optimization-test.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +if [ ! -z "$srcdir" ]; then + compare_ir=`pwd`/tests/compare_ir.py +else + compare_ir=./compare_ir.py +fi + +total=0 +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 .. + fi + echo "$dir" +done + +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 + total=$((total+1)) + if $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out" >/dev/null 2>&1; then + echo "PASS" + pass=$((pass+1)) + else + echo "FAIL" + $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out" + fi +done + +echo "" +echo "$pass/$total tests returned correct results" +echo "" + +if [[ $pass == $total ]]; then + exit 0 +else + exit 1 +fi diff --git a/src/compiler/glsl/tests/warnings-test b/src/compiler/glsl/tests/warnings-test deleted file mode 100755 index 1bea4665394..00000000000 --- a/src/compiler/glsl/tests/warnings-test +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -# Execute several shaders, and check that the InfoLog outcome is the expected. - -compiler=./glsl_compiler -total=0 -pass=0 - -echo "====== Testing compilation output ======" -for test in `find . -iname '*.vert'`; do - echo -n "Testing $test..." - $compiler --just-log --version 150 "$test" > "$test.out" 2>&1 - total=$((total+1)) - if diff "$test.expected" "$test.out" >/dev/null 2>&1; then - echo "PASS" - pass=$((pass+1)) - else - echo "FAIL" - diff "$test.expected" "$test.out" - fi -done - -echo "" -echo "$pass/$total tests returned correct results" -echo "" - -if [[ $pass == $total ]]; then - exit 0 -else - exit 1 -fi diff --git a/src/compiler/glsl/tests/warnings-test.sh b/src/compiler/glsl/tests/warnings-test.sh new file mode 100755 index 00000000000..1bea4665394 --- /dev/null +++ b/src/compiler/glsl/tests/warnings-test.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# Execute several shaders, and check that the InfoLog outcome is the expected. + +compiler=./glsl_compiler +total=0 +pass=0 + +echo "====== Testing compilation output ======" +for test in `find . -iname '*.vert'`; do + echo -n "Testing $test..." + $compiler --just-log --version 150 "$test" > "$test.out" 2>&1 + total=$((total+1)) + if diff "$test.expected" "$test.out" >/dev/null 2>&1; then + echo "PASS" + pass=$((pass+1)) + else + echo "FAIL" + diff "$test.expected" "$test.out" + fi +done + +echo "" +echo "$pass/$total tests returned correct results" +echo "" + +if [[ $pass == $total ]]; then + exit 0 +else + exit 1 +fi -- cgit v1.2.3