forked from FreeFem/FreeFem-sources
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CheckAllEdp
executable file
·69 lines (65 loc) · 1.62 KB
/
CheckAllEdp
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
red='[0;31m' # Red.
grn='[0;32m' # Green.
lgn='[1;32m' # Light green.
blu='[1;34m' # Blue.
mgn='[0;35m' # Magenta.
std='[m' # No color.
NL=0
NA=0
NX=0
NN=0
NO=0
NC=0
NF=0
cmm=$1;shift;
if [ $# -eq 0 ]; then
list=*.edp
elif [ $# -gt 0 ]; then
list="$@"
fi
for i in $list
do
case $i in
all.edp|regtests.edp)
echo pass $i;;
*)
((NN++))
( $cmm "$i" )2>&1 1>$i-out;
RES=$?
((SIG=$RES%128));
## error Compile error : Error load # 1
## error Compile error :
## Exec error : exec assert
## Exec error :
errl=`grep 'error Compile error : Error load' $i-out`
errC=`grep 'error Compile error :' $i-out`
errX=`grep 'Exec error :' $i-out`
errA=`grep 'Exec error : exec assert' $i-out`
# echo "$RES,$SIG,$errC,$errA."
if [ -n "$errl" ] ; then
((NL++))
MSG="${mgn} FAIL(load) ${std}"
elif [ -n "$errC" ] ; then
((NC++))
MSG="${lgn} FAIL(Compile) ${std}"
elif [ -n "$errA" -a $SIG -ne 0 ] ; then
((NA++))
MSG="${blu} FAIL(Assert) ${std}"
elif [ -n "$errX" -a $SIG -ne 0 ] ; then
((NX++))
MSG="${mgn} FAIL(Exec) ${std}"
elif [ $SIG -eq 0 ] ; then
((NO++))
MSG="${grn} OK (Exec) ${std}"
else
MSG="${red} FAIL(signal)=$SIG ${std}"
((NF++))
fi
echo $MSG $cmm $i >>$i-out
echo $MSG $cmm $i "( see $i-out )";
# echo $MSG $cmm $i "(see $i-out )" >>/tmp/list-ff-$$
;;
esac
done
echo "Nb Case $NN / ${grn}OK $NO / ${red} FAIL $NF / ${blu} Assert Error $NA/ ${lgn} Compile Error $NC / ${mgn} load Error $NL / Exec Error $NX${std}"