summaryrefslogtreecommitdiff
path: root/android/scripts/piglit-run-glslparser.sh
blob: a536f7076201d821f77b0ace3e79ed75266e03bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/system/bin/sh

set -x
# find and loop over the vert and frag tests found
# looks recursively down the directory tree

find ${2} -name "*.frag" -or -name "*.vert" -print0 | while read -d $'\0' file
do
   RESULTEXPECTED=$(grep expect_result ${file} )
   case $RESULTEXPECTED in
      *fail*) RESULTEXPECTED="fail";;

      *pass*) RESULTEXPECTED="pass";;

      *) RESULTEXPECTED="pass";;
   esac

   RESULT=$( ${1} ${file} $RESULTEXPECTED 1.00 -auto )

   PSTRING="PIGLIT: {'result': 'pass'"
   SSTRING="PIGLIT: {'result': 'skip'"
   FSTRING="PIGLIT: {'result': 'fail'"

   case $RESULT in
      *"$PSTRING"*) 
            if $RESULTEXPECTED = "pass"; then 
               echo "${1} ${file}: pass" 
            else 
               echo "${1} ${file}: fail"
            fi
            ;;

      *"$SSTRING"*) echo "${1} ${file}: skip";;
  
      *"$FSTRING"*)
            if $RESULTEXPECTED = "fail"; then 
               echo "${1} ${file}: pass" 
            else 
               echo "${1} ${file}: fail"
            fi
            ;;

      *) echo "${1} ${file}: fail";;
   esac
done