blob: 73b15a7cbabcb4e4dee79717684d7adf4205a6de [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 Kessenich08d18242013-12-20 18:36:27 +00006mkdir -p localResults
John Kessenich69f4b512013-09-04 21:19:27 +00007
8#
John Kessenicha5830df2013-10-02 05:10:48 +00009# configuration file tests
John Kessenich05a70632013-09-17 19:26:08 +000010#
11echo running configuration file test
12$EXE -c > $TARGETDIR/test.conf
13diff -b $BASEDIR/test.conf $TARGETDIR/test.conf
John Kessenich5134b9c2013-11-20 21:12:43 +000014$EXE -i -l $TARGETDIR/test.conf specExamples.vert > $TARGETDIR/specExamples.vert.out
John Kessenich05a70632013-09-17 19:26:08 +000015diff -b $BASEDIR/specExamples.vert.out $TARGETDIR
John Kessenicha5830df2013-10-02 05:10:48 +000016$EXE 100Limits.vert 100.conf > $TARGETDIR/100LimitsConf.vert.out
17diff -b $BASEDIR/100LimitsConf.vert.out $TARGETDIR/100LimitsConf.vert.out
John Kessenich05a70632013-09-17 19:26:08 +000018
19#
John Kessenich69f4b512013-09-04 21:19:27 +000020# isolated compilation tests
21#
John Kessenichaab25142013-02-12 18:26:15 +000022while read t; do
23 echo Running $t...
John Kessenich69f4b512013-09-04 21:19:27 +000024 b=`basename $t`
John Kessenich5134b9c2013-11-20 21:12:43 +000025 $EXE -i -l $t > $TARGETDIR/$b.out
John Kessenich8d2fe452013-08-05 16:36:49 +000026 diff -b $BASEDIR/$b.out $TARGETDIR/$b.out
John Kessenichb3338b32013-02-26 19:47:21 +000027done < testlist
John Kessenich69f4b512013-09-04 21:19:27 +000028
John Kessenichcf0206c2014-04-14 15:46:40 +000029if [ -a localtestlist ]
30 then
31 while read t; do
32 echo Running $t...
33 b=`basename $t`
34 $EXE -i -l $t > $TARGETDIR/$b.out
35 diff -b $BASEDIR/$b.out $TARGETDIR/$b.out
36 done < localtestlist
37fi
38
John Kessenich69f4b512013-09-04 21:19:27 +000039#
John Kesseniche8fe7b82013-12-18 18:47:12 +000040# grouped shaders for bulk (faster) tests
John Kessenich69f4b512013-09-04 21:19:27 +000041#
John Kesseniche8fe7b82013-12-18 18:47:12 +000042function runBulkTest {
John Kessenich69f4b512013-09-04 21:19:27 +000043 echo Running $*...
John Kesseniche8fe7b82013-12-18 18:47:12 +000044 $EXE -i -l -t $* > $TARGETDIR/$1.out
John Kessenichcf0206c2014-04-14 15:46:40 +000045 diff -b $BASEDIR/$1.out $TARGETDIR/$1.out
John Kessenich69f4b512013-09-04 21:19:27 +000046}
47
John Kesseniche8fe7b82013-12-18 18:47:12 +000048runBulkTest mains1.frag mains2.frag noMain1.geom noMain2.geom
49runBulkTest noMain.vert mains.frag
50runBulkTest link1.frag link2.frag link3.frag
51runBulkTest recurse1.vert recurse1.frag recurse2.frag
52runBulkTest 300link.frag
53runBulkTest 300link2.frag
54runBulkTest 300link3.frag
55runBulkTest empty.frag empty2.frag empty3.frag
56runBulkTest 150.tesc 150.tese 400.tesc 400.tese 410.tesc 420.tesc 420.tese
John Kessenich38f3b892013-09-06 19:52:57 +000057
58#
John Kessenich11f9fc72013-11-07 01:06:34 +000059# reflection tests
60#
61echo Running reflection...
62$EXE -l -q reflection.vert > $TARGETDIR/reflection.vert.out
63diff -b $BASEDIR/reflection.vert.out $TARGETDIR/reflection.vert.out
64
65#
John Kessenich38f3b892013-09-06 19:52:57 +000066# multi-threaded test
67#
John Kessenich38f3b892013-09-06 19:52:57 +000068echo Comparing single thread to multithread for all tests in current directory...
69$EXE -i *.vert *.geom *.frag *.tes* *.comp > singleThread.out
70$EXE -i *.vert *.geom *.frag *.tes* *.comp -t > multiThread.out
71diff singleThread.out multiThread.out