blob: a93444c0f11a0be04f3bef269b9cc140476340ce [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
29#
John Kesseniche8fe7b82013-12-18 18:47:12 +000030# grouped shaders for bulk (faster) tests
John Kessenich69f4b512013-09-04 21:19:27 +000031#
John Kesseniche8fe7b82013-12-18 18:47:12 +000032function runBulkTest {
John Kessenich69f4b512013-09-04 21:19:27 +000033 echo Running $*...
John Kesseniche8fe7b82013-12-18 18:47:12 +000034 $EXE -i -l -t $* > $TARGETDIR/$1.out
John Kessenich69f4b512013-09-04 21:19:27 +000035 diff -b $BASEDIR/$1.out $TARGETDIR/$1.out
36}
37
John Kesseniche8fe7b82013-12-18 18:47:12 +000038runBulkTest mains1.frag mains2.frag noMain1.geom noMain2.geom
39runBulkTest noMain.vert mains.frag
40runBulkTest link1.frag link2.frag link3.frag
41runBulkTest recurse1.vert recurse1.frag recurse2.frag
42runBulkTest 300link.frag
43runBulkTest 300link2.frag
44runBulkTest 300link3.frag
45runBulkTest empty.frag empty2.frag empty3.frag
46runBulkTest 150.tesc 150.tese 400.tesc 400.tese 410.tesc 420.tesc 420.tese
John Kessenich38f3b892013-09-06 19:52:57 +000047
48#
John Kessenich11f9fc72013-11-07 01:06:34 +000049# reflection tests
50#
51echo Running reflection...
52$EXE -l -q reflection.vert > $TARGETDIR/reflection.vert.out
53diff -b $BASEDIR/reflection.vert.out $TARGETDIR/reflection.vert.out
54
55#
John Kessenich38f3b892013-09-06 19:52:57 +000056# multi-threaded test
57#
John Kessenich38f3b892013-09-06 19:52:57 +000058echo Comparing single thread to multithread for all tests in current directory...
59$EXE -i *.vert *.geom *.frag *.tes* *.comp > singleThread.out
60$EXE -i *.vert *.geom *.frag *.tes* *.comp -t > multiThread.out
61diff singleThread.out multiThread.out