blob: 18513380841180cef5419e07e1d9643a6540ffae [file] [log] [blame]
John Kessenichaab25142013-02-12 18:26:15 +00001#!/usr/bin/env bash
2
John Kessenich4586dbd2013-08-05 15:52:03 +00003TARGETDIR=localResults
4BASEDIR=baseResults
John Kessenichd18e2d82014-03-11 02:10:26 +00005EXE=../build/install/bin/glslangValidator
John Kessenichb38c9692015-05-15 19:01:17 +00006HASERROR=0
John Kessenich08d18242013-12-20 18:36:27 +00007mkdir -p localResults
John Kessenich69f4b512013-09-04 21:19:27 +00008
John Kessenichcf0206c2014-04-14 15:46:40 +00009if [ -a localtestlist ]
10 then
11 while read t; do
12 echo Running $t...
13 b=`basename $t`
14 $EXE -i -l $t > $TARGETDIR/$b.out
John Kessenichb38c9692015-05-15 19:01:17 +000015 diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1
John Kessenichcf0206c2014-04-14 15:46:40 +000016 done < localtestlist
17fi
18
johnkslang02ad18a2015-06-26 00:12:31 -060019rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv
John Kessenich593a3f72015-05-15 18:44:16 +000020
21#
John Kessenich31a51be2016-07-19 14:32:52 -060022# special tests
23#
24
25$EXE badMacroArgs.frag > $TARGETDIR/badMacroArgs.frag.out
26diff -b $BASEDIR/badMacroArgs.frag.out $TARGETDIR/badMacroArgs.frag.out || HASERROR=1
27
28#
John Kessenich11f9fc72013-11-07 01:06:34 +000029# reflection tests
30#
31echo Running reflection...
John Kessenicha86836e2016-07-09 14:50:57 -060032$EXE -l -q -C reflection.vert > $TARGETDIR/reflection.vert.out
John Kessenichb38c9692015-05-15 19:01:17 +000033diff -b $BASEDIR/reflection.vert.out $TARGETDIR/reflection.vert.out || HASERROR=1
John Kessenich2572b192016-09-19 23:12:48 -060034$EXE -D -e flizv -l -q -C -V hlsl.reflection.vert > $TARGETDIR/hlsl.reflection.vert.out
35diff -b $BASEDIR/hlsl.reflection.vert.out $TARGETDIR/hlsl.reflection.vert.out || HASERROR=1
John Kessenich11f9fc72013-11-07 01:06:34 +000036
37#
John Kessenich38f3b892013-09-06 19:52:57 +000038# multi-threaded test
39#
John Kessenich38f3b892013-09-06 19:52:57 +000040echo Comparing single thread to multithread for all tests in current directory...
John Kessenicha86836e2016-07-09 14:50:57 -060041$EXE -i -C *.vert *.geom *.frag *.tes* *.comp > singleThread.out
42$EXE -i -C *.vert *.geom *.frag *.tes* *.comp -t > multiThread.out
John Kessenichb38c9692015-05-15 19:01:17 +000043diff singleThread.out multiThread.out || HASERROR=1
44
John Kessenich84ea15f2015-05-15 21:54:24 +000045if [ $HASERROR -eq 0 ]
46then
47 echo Tests Succeeded.
48else
49 echo Tests Failed.
50fi
51
John Kessenichb38c9692015-05-15 19:01:17 +000052exit $HASERROR