John Kessenich | aab2514 | 2013-02-12 18:26:15 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
John Kessenich | 4586dbd | 2013-08-05 15:52:03 +0000 | [diff] [blame] | 3 | TARGETDIR=localResults |
| 4 | BASEDIR=baseResults |
John Kessenich | d18e2d8 | 2014-03-11 02:10:26 +0000 | [diff] [blame] | 5 | EXE=../build/install/bin/glslangValidator |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 6 | HASERROR=0 |
John Kessenich | 08d1824 | 2013-12-20 18:36:27 +0000 | [diff] [blame] | 7 | mkdir -p localResults |
John Kessenich | 69f4b51 | 2013-09-04 21:19:27 +0000 | [diff] [blame] | 8 | |
John Kessenich | cf0206c | 2014-04-14 15:46:40 +0000 | [diff] [blame] | 9 | if [ -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 Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 15 | diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1 |
John Kessenich | cf0206c | 2014-04-14 15:46:40 +0000 | [diff] [blame] | 16 | done < localtestlist |
| 17 | fi |
| 18 | |
johnkslang | 02ad18a | 2015-06-26 00:12:31 -0600 | [diff] [blame] | 19 | rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv |
John Kessenich | 593a3f7 | 2015-05-15 18:44:16 +0000 | [diff] [blame] | 20 | |
| 21 | # |
John Kessenich | 31a51be | 2016-07-19 14:32:52 -0600 | [diff] [blame] | 22 | # special tests |
| 23 | # |
| 24 | |
| 25 | $EXE badMacroArgs.frag > $TARGETDIR/badMacroArgs.frag.out |
| 26 | diff -b $BASEDIR/badMacroArgs.frag.out $TARGETDIR/badMacroArgs.frag.out || HASERROR=1 |
| 27 | |
| 28 | # |
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 29 | # reflection tests |
| 30 | # |
| 31 | echo Running reflection... |
John Kessenich | a86836e | 2016-07-09 14:50:57 -0600 | [diff] [blame] | 32 | $EXE -l -q -C reflection.vert > $TARGETDIR/reflection.vert.out |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 33 | diff -b $BASEDIR/reflection.vert.out $TARGETDIR/reflection.vert.out || HASERROR=1 |
John Kessenich | 2572b19 | 2016-09-19 23:12:48 -0600 | [diff] [blame] | 34 | $EXE -D -e flizv -l -q -C -V hlsl.reflection.vert > $TARGETDIR/hlsl.reflection.vert.out |
| 35 | diff -b $BASEDIR/hlsl.reflection.vert.out $TARGETDIR/hlsl.reflection.vert.out || HASERROR=1 |
steve-lunarg | 8ffc36a | 2016-09-21 14:19:40 -0600 | [diff] [blame] | 36 | $EXE -D -e main -l -q -C -V hlsl.reflection.binding.frag > $TARGETDIR/hlsl.reflection.binding.frag.out |
| 37 | diff -b $BASEDIR/hlsl.reflection.binding.frag.out $TARGETDIR/hlsl.reflection.binding.frag.out || HASERROR=1 |
| 38 | |
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 39 | |
| 40 | # |
John Kessenich | 38f3b89 | 2013-09-06 19:52:57 +0000 | [diff] [blame] | 41 | # multi-threaded test |
| 42 | # |
John Kessenich | 38f3b89 | 2013-09-06 19:52:57 +0000 | [diff] [blame] | 43 | echo Comparing single thread to multithread for all tests in current directory... |
John Kessenich | a86836e | 2016-07-09 14:50:57 -0600 | [diff] [blame] | 44 | $EXE -i -C *.vert *.geom *.frag *.tes* *.comp > singleThread.out |
| 45 | $EXE -i -C *.vert *.geom *.frag *.tes* *.comp -t > multiThread.out |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 46 | diff singleThread.out multiThread.out || HASERROR=1 |
| 47 | |
steve-lunarg | f1e0c87 | 2016-10-31 15:13:43 -0600 | [diff] [blame] | 48 | # |
| 49 | # entry point renaming tests |
| 50 | # |
John Kessenich | 906cc21 | 2016-12-09 19:22:20 -0700 | [diff] [blame^] | 51 | echo Running entry-point renaming tests |
| 52 | $EXE -i -H -V -D -e main_in_spv --ku --source-entrypoint main hlsl.entry.rename.frag > $TARGETDIR/hlsl.entry.rename.frag.out |
steve-lunarg | f1e0c87 | 2016-10-31 15:13:43 -0600 | [diff] [blame] | 53 | diff -b $BASEDIR/hlsl.entry.rename.frag.out $TARGETDIR/hlsl.entry.rename.frag.out || HASERROR=1 |
| 54 | |
John Kessenich | 906cc21 | 2016-12-09 19:22:20 -0700 | [diff] [blame^] | 55 | # |
| 56 | # Testing ill-defined uncalled function |
| 57 | # |
| 58 | echo Running ill-defined uncalled function |
| 59 | $EXE -D -e main -H hlsl.deadFunctionMissingBody.vert > $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out |
| 60 | diff -b $BASEDIR/hlsl.deadFunctionMissingBody.vert.out $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out || HASERROR=1 |
| 61 | |
John Kessenich | 84ea15f | 2015-05-15 21:54:24 +0000 | [diff] [blame] | 62 | if [ $HASERROR -eq 0 ] |
| 63 | then |
| 64 | echo Tests Succeeded. |
| 65 | else |
| 66 | echo Tests Failed. |
| 67 | fi |
| 68 | |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 69 | exit $HASERROR |