blob: a17848b74caf60d12e242e490a85c6a65ece51ef [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
steve-lunarg8ffc36a2016-09-21 14:19:40 -060036$EXE -D -e main -l -q -C -V hlsl.reflection.binding.frag > $TARGETDIR/hlsl.reflection.binding.frag.out
37diff -b $BASEDIR/hlsl.reflection.binding.frag.out $TARGETDIR/hlsl.reflection.binding.frag.out || HASERROR=1
38
John Kessenich11f9fc72013-11-07 01:06:34 +000039
40#
John Kessenich38f3b892013-09-06 19:52:57 +000041# multi-threaded test
42#
John Kessenich38f3b892013-09-06 19:52:57 +000043echo Comparing single thread to multithread for all tests in current directory...
John Kessenicha86836e2016-07-09 14:50:57 -060044$EXE -i -C *.vert *.geom *.frag *.tes* *.comp > singleThread.out
45$EXE -i -C *.vert *.geom *.frag *.tes* *.comp -t > multiThread.out
John Kessenichb38c9692015-05-15 19:01:17 +000046diff singleThread.out multiThread.out || HASERROR=1
47
steve-lunargf1e0c872016-10-31 15:13:43 -060048#
49# entry point renaming tests
50#
John Kessenich906cc212016-12-09 19:22:20 -070051echo 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-lunargf1e0c872016-10-31 15:13:43 -060053diff -b $BASEDIR/hlsl.entry.rename.frag.out $TARGETDIR/hlsl.entry.rename.frag.out || HASERROR=1
54
John Kessenich906cc212016-12-09 19:22:20 -070055#
56# Testing ill-defined uncalled function
57#
58echo Running ill-defined uncalled function
59$EXE -D -e main -H hlsl.deadFunctionMissingBody.vert > $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out
60diff -b $BASEDIR/hlsl.deadFunctionMissingBody.vert.out $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out || HASERROR=1
61
John Kessenich84ea15f2015-05-15 21:54:24 +000062if [ $HASERROR -eq 0 ]
63then
64 echo Tests Succeeded.
65else
66 echo Tests Failed.
67fi
68
John Kessenichb38c9692015-05-15 19:01:17 +000069exit $HASERROR