Merge pull request #2913 from greg-lunarg/i2905
[platform/upstream/glslang.git] / Test / web.runtests
1 #!/usr/bin/env bash
2
3 TESTLIST=web.testlist
4 TARGETDIR=localResults
5 BASEDIR=baseResults
6 EXE=../build/install/bin/glslangValidator.exe
7 HASERROR=0
8 mkdir -p $TARGETDIR
9
10 if [ -a $TESTLIST ]
11   then
12     while read t; do
13       echo Running $t...
14       b=`basename $t`
15       $EXE -V -o webtest.spv $t
16       spirv-dis webtest.spv > $TARGETDIR/$b.out
17       rm -f webtest.spv
18       diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1
19     done < $TESTLIST
20 else
21   echo $TESTLIST is missing
22 fi
23
24 wc --bytes $EXE > $TARGETDIR/size
25 echo "base size was" `cat $BASEDIR/size`
26 echo "new  size  is" `cat $TARGETDIR/size`
27
28 #
29 # Final checking
30 #
31 if [ $HASERROR -eq 0 ]
32 then
33     echo Tests Succeeded.
34 else
35     echo Tests Failed.
36 fi
37
38 exit $HASERROR