-
Notifications
You must be signed in to change notification settings - Fork 8
/
dovtest
executable file
·57 lines (49 loc) · 981 Bytes
/
dovtest
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
#!/usr/bin/env bash
dir=$PWD
while [ ! -f $dir/wiggle ]
do
if [ -z "$dir" ]; then
echo >&2 Cannot find wiggle program : $WIGGLE
exit 1
fi
dir=${dir%/*}
done
export WIGGLE=$dir/wiggle
if [ -d tests ]
then cd tests
fi
vallog=/tmp/valg.log-$$
> $vallog
VG="valgrind --log-file=$vallog"
status=0
ok=0
fail=0
find . -name core | xargs rm -f
list=$(find . -type f -name merge )
WIGGLE="$WIGGLE --self-test"
for path in $list
do
dir=${path%/*}
(
cd $dir
if [ -f patch ]
then $VG $WIGGLE -B orig patch
elif [ -f new ]
then $VG $WIGGLE -B orig new new2
else $VG $WIGGLE -B orig
fi
if grep 'ERROR SUMMARY: [1-9]' $vallog > /dev/null 2>&1
then msg="VALGRIND ERRORS"; xit=1 ; mv $vallog $vallog-${dir////-}
else msg="SUCCESS"; xit=0
fi
echo $path $msg
exit $xit
)
if [ $? = 0 ]
then let ok++;
else status=1 ; let fail++
fi
done
find . -name core -ls
echo $ok succeeded and $fail failed
exit $status