2013-02-12 18:26:15 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2013-08-05 15:52:03 +00:00
|
|
|
TARGETDIR=localResults
|
|
|
|
BASEDIR=baseResults
|
2014-03-11 02:10:26 +00:00
|
|
|
EXE=../build/install/bin/glslangValidator
|
2015-05-15 19:01:17 +00:00
|
|
|
HASERROR=0
|
2013-12-20 18:36:27 +00:00
|
|
|
mkdir -p localResults
|
2013-09-04 21:19:27 +00:00
|
|
|
|
|
|
|
#
|
2013-10-02 05:10:48 +00:00
|
|
|
# configuration file tests
|
2013-09-04 21:19:27 +00:00
|
|
|
#
|
2013-09-17 19:26:08 +00:00
|
|
|
echo running configuration file test
|
|
|
|
$EXE -c > $TARGETDIR/test.conf
|
2015-05-15 19:01:17 +00:00
|
|
|
diff -b $BASEDIR/test.conf $TARGETDIR/test.conf || HASERROR=1
|
2013-11-20 21:12:43 +00:00
|
|
|
$EXE -i -l $TARGETDIR/test.conf specExamples.vert > $TARGETDIR/specExamples.vert.out
|
2015-05-15 19:01:17 +00:00
|
|
|
diff -b $BASEDIR/specExamples.vert.out $TARGETDIR || HASERROR=1
|
2013-10-02 05:10:48 +00:00
|
|
|
$EXE 100Limits.vert 100.conf > $TARGETDIR/100LimitsConf.vert.out
|
2015-05-15 19:01:17 +00:00
|
|
|
diff -b $BASEDIR/100LimitsConf.vert.out $TARGETDIR/100LimitsConf.vert.out || HASERROR=1
|
2013-02-12 18:26:15 +00:00
|
|
|
|
2013-09-17 19:26:08 +00:00
|
|
|
#
|
|
|
|
# isolated compilation tests
|
|
|
|
#
|
2013-02-12 18:26:15 +00:00
|
|
|
while read t; do
|
|
|
|
echo Running $t...
|
2013-09-04 21:19:27 +00:00
|
|
|
b=`basename $t`
|
2013-11-20 21:12:43 +00:00
|
|
|
$EXE -i -l $t > $TARGETDIR/$b.out
|
2015-05-15 19:01:17 +00:00
|
|
|
diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1
|
2013-02-26 19:47:21 +00:00
|
|
|
done < testlist
|
2013-09-04 21:19:27 +00:00
|
|
|
|
2014-04-14 15:46:40 +00:00
|
|
|
if [ -a localtestlist ]
|
|
|
|
then
|
|
|
|
while read t; do
|
|
|
|
echo Running $t...
|
|
|
|
b=`basename $t`
|
|
|
|
$EXE -i -l $t > $TARGETDIR/$b.out
|
2015-05-15 19:01:17 +00:00
|
|
|
diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1
|
2014-04-14 15:46:40 +00:00
|
|
|
done < localtestlist
|
|
|
|
fi
|
|
|
|
|
2015-05-15 18:44:16 +00:00
|
|
|
#
|
|
|
|
# SPIR-V code generation tests
|
|
|
|
#
|
2015-06-16 18:40:40 +00:00
|
|
|
while read t; do
|
|
|
|
case $t in
|
|
|
|
\#*)
|
|
|
|
# Skip comment lines in the test list file.
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo Running SPIR-V $t...
|
|
|
|
b=`basename $t`
|
|
|
|
$EXE -H $t > $TARGETDIR/$b.out
|
|
|
|
diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done < test-spirv-list
|
2015-06-26 06:12:31 +00:00
|
|
|
rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv
|
2015-05-15 18:44:16 +00:00
|
|
|
|
2015-06-17 02:38:44 +00:00
|
|
|
#
|
|
|
|
# Preprocessor tests
|
|
|
|
#
|
|
|
|
while read t; do
|
|
|
|
echo Running Preprocessor $t...
|
|
|
|
b=`basename $t`
|
2015-06-24 21:00:46 +00:00
|
|
|
$EXE -E $t > $TARGETDIR/$b.out 2> $TARGETDIR/$b.err
|
2015-06-17 02:38:44 +00:00
|
|
|
diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1
|
2015-06-24 21:00:46 +00:00
|
|
|
diff -b $BASEDIR/$b.err $TARGETDIR/$b.err || HASERROR=1
|
2015-06-17 02:38:44 +00:00
|
|
|
done < test-preprocessor-list
|
|
|
|
|
2013-09-04 21:19:27 +00:00
|
|
|
#
|
2013-12-18 18:47:12 +00:00
|
|
|
# grouped shaders for bulk (faster) tests
|
2013-09-04 21:19:27 +00:00
|
|
|
#
|
2013-12-18 18:47:12 +00:00
|
|
|
function runBulkTest {
|
2013-09-04 21:19:27 +00:00
|
|
|
echo Running $*...
|
2013-12-18 18:47:12 +00:00
|
|
|
$EXE -i -l -t $* > $TARGETDIR/$1.out
|
2015-05-15 19:01:17 +00:00
|
|
|
diff -b $BASEDIR/$1.out $TARGETDIR/$1.out || HASERROR=1
|
2013-09-04 21:19:27 +00:00
|
|
|
}
|
|
|
|
|
2013-12-18 18:47:12 +00:00
|
|
|
runBulkTest mains1.frag mains2.frag noMain1.geom noMain2.geom
|
|
|
|
runBulkTest noMain.vert mains.frag
|
|
|
|
runBulkTest link1.frag link2.frag link3.frag
|
|
|
|
runBulkTest recurse1.vert recurse1.frag recurse2.frag
|
|
|
|
runBulkTest 300link.frag
|
|
|
|
runBulkTest 300link2.frag
|
|
|
|
runBulkTest 300link3.frag
|
|
|
|
runBulkTest empty.frag empty2.frag empty3.frag
|
|
|
|
runBulkTest 150.tesc 150.tese 400.tesc 400.tese 410.tesc 420.tesc 420.tese
|
2013-09-06 19:52:57 +00:00
|
|
|
|
2013-11-07 01:06:34 +00:00
|
|
|
#
|
|
|
|
# reflection tests
|
|
|
|
#
|
|
|
|
echo Running reflection...
|
|
|
|
$EXE -l -q reflection.vert > $TARGETDIR/reflection.vert.out
|
2015-05-15 19:01:17 +00:00
|
|
|
diff -b $BASEDIR/reflection.vert.out $TARGETDIR/reflection.vert.out || HASERROR=1
|
2013-11-07 01:06:34 +00:00
|
|
|
|
2013-09-06 19:52:57 +00:00
|
|
|
#
|
|
|
|
# multi-threaded test
|
|
|
|
#
|
|
|
|
echo Comparing single thread to multithread for all tests in current directory...
|
|
|
|
$EXE -i *.vert *.geom *.frag *.tes* *.comp > singleThread.out
|
|
|
|
$EXE -i *.vert *.geom *.frag *.tes* *.comp -t > multiThread.out
|
2015-05-15 19:01:17 +00:00
|
|
|
diff singleThread.out multiThread.out || HASERROR=1
|
|
|
|
|
2015-05-15 21:54:24 +00:00
|
|
|
if [ $HASERROR -eq 0 ]
|
|
|
|
then
|
|
|
|
echo Tests Succeeded.
|
|
|
|
else
|
|
|
|
echo Tests Failed.
|
|
|
|
fi
|
|
|
|
|
2015-05-15 19:01:17 +00:00
|
|
|
exit $HASERROR
|