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 | |
| 9 | # |
John Kessenich | a5830df | 2013-10-02 05:10:48 +0000 | [diff] [blame] | 10 | # configuration file tests |
John Kessenich | 05a7063 | 2013-09-17 19:26:08 +0000 | [diff] [blame] | 11 | # |
| 12 | echo running configuration file test |
| 13 | $EXE -c > $TARGETDIR/test.conf |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame^] | 14 | diff -b $BASEDIR/test.conf $TARGETDIR/test.conf || HASERROR=1 |
John Kessenich | 5134b9c | 2013-11-20 21:12:43 +0000 | [diff] [blame] | 15 | $EXE -i -l $TARGETDIR/test.conf specExamples.vert > $TARGETDIR/specExamples.vert.out |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame^] | 16 | diff -b $BASEDIR/specExamples.vert.out $TARGETDIR || HASERROR=1 |
John Kessenich | a5830df | 2013-10-02 05:10:48 +0000 | [diff] [blame] | 17 | $EXE 100Limits.vert 100.conf > $TARGETDIR/100LimitsConf.vert.out |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame^] | 18 | diff -b $BASEDIR/100LimitsConf.vert.out $TARGETDIR/100LimitsConf.vert.out || HASERROR=1 |
John Kessenich | 05a7063 | 2013-09-17 19:26:08 +0000 | [diff] [blame] | 19 | |
| 20 | # |
John Kessenich | 69f4b51 | 2013-09-04 21:19:27 +0000 | [diff] [blame] | 21 | # isolated compilation tests |
| 22 | # |
John Kessenich | aab2514 | 2013-02-12 18:26:15 +0000 | [diff] [blame] | 23 | while read t; do |
| 24 | echo Running $t... |
John Kessenich | 69f4b51 | 2013-09-04 21:19:27 +0000 | [diff] [blame] | 25 | b=`basename $t` |
John Kessenich | 5134b9c | 2013-11-20 21:12:43 +0000 | [diff] [blame] | 26 | $EXE -i -l $t > $TARGETDIR/$b.out |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame^] | 27 | diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1 |
John Kessenich | b3338b3 | 2013-02-26 19:47:21 +0000 | [diff] [blame] | 28 | done < testlist |
John Kessenich | 69f4b51 | 2013-09-04 21:19:27 +0000 | [diff] [blame] | 29 | |
John Kessenich | cf0206c | 2014-04-14 15:46:40 +0000 | [diff] [blame] | 30 | if [ -a localtestlist ] |
| 31 | then |
| 32 | while read t; do |
| 33 | echo Running $t... |
| 34 | b=`basename $t` |
| 35 | $EXE -i -l $t > $TARGETDIR/$b.out |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame^] | 36 | diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1 |
John Kessenich | cf0206c | 2014-04-14 15:46:40 +0000 | [diff] [blame] | 37 | done < localtestlist |
| 38 | fi |
| 39 | |
John Kessenich | 69f4b51 | 2013-09-04 21:19:27 +0000 | [diff] [blame] | 40 | # |
John Kessenich | 593a3f7 | 2015-05-15 18:44:16 +0000 | [diff] [blame] | 41 | # SPIR-V code generation tests |
| 42 | # |
| 43 | grep -v "^#" test-spirv-list | while read t; do |
| 44 | echo Running SPIR-V $t... |
| 45 | b=`basename $t` |
| 46 | $EXE -H $t > $TARGETDIR/$b.out |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame^] | 47 | diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1 |
John Kessenich | 593a3f7 | 2015-05-15 18:44:16 +0000 | [diff] [blame] | 48 | done |
| 49 | |
| 50 | # |
John Kessenich | e8fe7b8 | 2013-12-18 18:47:12 +0000 | [diff] [blame] | 51 | # grouped shaders for bulk (faster) tests |
John Kessenich | 69f4b51 | 2013-09-04 21:19:27 +0000 | [diff] [blame] | 52 | # |
John Kessenich | e8fe7b8 | 2013-12-18 18:47:12 +0000 | [diff] [blame] | 53 | function runBulkTest { |
John Kessenich | 69f4b51 | 2013-09-04 21:19:27 +0000 | [diff] [blame] | 54 | echo Running $*... |
John Kessenich | e8fe7b8 | 2013-12-18 18:47:12 +0000 | [diff] [blame] | 55 | $EXE -i -l -t $* > $TARGETDIR/$1.out |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame^] | 56 | diff -b $BASEDIR/$1.out $TARGETDIR/$1.out || HASERROR=1 |
John Kessenich | 69f4b51 | 2013-09-04 21:19:27 +0000 | [diff] [blame] | 57 | } |
| 58 | |
John Kessenich | e8fe7b8 | 2013-12-18 18:47:12 +0000 | [diff] [blame] | 59 | runBulkTest mains1.frag mains2.frag noMain1.geom noMain2.geom |
| 60 | runBulkTest noMain.vert mains.frag |
| 61 | runBulkTest link1.frag link2.frag link3.frag |
| 62 | runBulkTest recurse1.vert recurse1.frag recurse2.frag |
| 63 | runBulkTest 300link.frag |
| 64 | runBulkTest 300link2.frag |
| 65 | runBulkTest 300link3.frag |
| 66 | runBulkTest empty.frag empty2.frag empty3.frag |
| 67 | runBulkTest 150.tesc 150.tese 400.tesc 400.tese 410.tesc 420.tesc 420.tese |
John Kessenich | 38f3b89 | 2013-09-06 19:52:57 +0000 | [diff] [blame] | 68 | |
| 69 | # |
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 70 | # reflection tests |
| 71 | # |
| 72 | echo Running reflection... |
| 73 | $EXE -l -q reflection.vert > $TARGETDIR/reflection.vert.out |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame^] | 74 | diff -b $BASEDIR/reflection.vert.out $TARGETDIR/reflection.vert.out || HASERROR=1 |
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 75 | |
| 76 | # |
John Kessenich | 38f3b89 | 2013-09-06 19:52:57 +0000 | [diff] [blame] | 77 | # multi-threaded test |
| 78 | # |
John Kessenich | 38f3b89 | 2013-09-06 19:52:57 +0000 | [diff] [blame] | 79 | echo Comparing single thread to multithread for all tests in current directory... |
| 80 | $EXE -i *.vert *.geom *.frag *.tes* *.comp > singleThread.out |
| 81 | $EXE -i *.vert *.geom *.frag *.tes* *.comp -t > multiThread.out |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame^] | 82 | diff singleThread.out multiThread.out || HASERROR=1 |
| 83 | |
| 84 | exit $HASERROR |