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
|
|
|
|
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-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
|
|
|
|
2016-07-19 20:32:52 +00:00
|
|
|
#
|
|
|
|
# special tests
|
|
|
|
#
|
|
|
|
|
|
|
|
$EXE badMacroArgs.frag > $TARGETDIR/badMacroArgs.frag.out
|
|
|
|
diff -b $BASEDIR/badMacroArgs.frag.out $TARGETDIR/badMacroArgs.frag.out || HASERROR=1
|
|
|
|
|
2013-11-07 01:06:34 +00:00
|
|
|
#
|
|
|
|
# reflection tests
|
|
|
|
#
|
|
|
|
echo Running reflection...
|
2016-07-09 20:50:57 +00:00
|
|
|
$EXE -l -q -C 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
|
2016-09-20 05:12:48 +00:00
|
|
|
$EXE -D -e flizv -l -q -C -V hlsl.reflection.vert > $TARGETDIR/hlsl.reflection.vert.out
|
|
|
|
diff -b $BASEDIR/hlsl.reflection.vert.out $TARGETDIR/hlsl.reflection.vert.out || HASERROR=1
|
2016-09-21 20:19:40 +00:00
|
|
|
$EXE -D -e main -l -q -C -V hlsl.reflection.binding.frag > $TARGETDIR/hlsl.reflection.binding.frag.out
|
|
|
|
diff -b $BASEDIR/hlsl.reflection.binding.frag.out $TARGETDIR/hlsl.reflection.binding.frag.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...
|
2016-07-09 20:50:57 +00:00
|
|
|
$EXE -i -C *.vert *.geom *.frag *.tes* *.comp > singleThread.out
|
|
|
|
$EXE -i -C *.vert *.geom *.frag *.tes* *.comp -t > multiThread.out
|
2015-05-15 19:01:17 +00:00
|
|
|
diff singleThread.out multiThread.out || HASERROR=1
|
|
|
|
|
2016-10-31 21:13:43 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# entry point renaming tests
|
|
|
|
#
|
2016-12-05 16:30:02 +00:00
|
|
|
$EXE -i -H -V -D -e main_in_spv --source-entrypoint main hlsl.entry.rename.frag > $TARGETDIR/hlsl.entry.rename.frag.out
|
2016-10-31 21:13:43 +00:00
|
|
|
diff -b $BASEDIR/hlsl.entry.rename.frag.out $TARGETDIR/hlsl.entry.rename.frag.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
|