Tizen 2.0 Alpha
[toolchains/unifdef.git] / runtests.sh
1 #!/bin/sh
2
3 ${1:+cd} ${1:-:}
4 for cmd in *.sh
5 do
6         t=${cmd%.sh}
7
8         . ./${cmd} >${t}.out 2>${t}.err
9         echo $? >${t}.rc
10
11         ok=true
12         for e in out err rc
13         do
14                 exp=${t}.exp${e}
15                 got=${t}.${e}
16                 if ! cmp -s ${exp} ${got}
17                 then
18                         echo FAILED: ${got}: $(cat ${cmd})
19                         diff -u ${exp} ${got}
20                         ok=false
21                 fi
22         done
23
24         if ${ok}
25         then rm -f ${t}.out ${t}.err ${t}.rc
26         else rc=1
27         fi
28 done
29 exit ${rc}