-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathverify.sh
More file actions
34 lines (30 loc) · 773 Bytes
/
verify.sh
File metadata and controls
34 lines (30 loc) · 773 Bytes
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
#!/bin/sh
# iterate over directories
while [ $# -gt 0 ]
do
i="$1"
# compute list of classes
flist=`find $i -name \*.class`
# iterate over classes
for f in $flist; do
cname=`expr $f : '\(.*\).class'`
echo -n "Verifying $cname ..."
if java -verify -cp $i/..:../jaskell/bin $cname > /tmp/jout 2>&1 ; then
echo "OK"
elif grep "java.lang.NoSuchMethodError: main" /tmp/jout > /dev/null 2>&1; then
echo "OK"
else
echo "KO"
echo "======= Class $cname =======" >> /tmp/jerr
cat /tmp/jout >> /tmp/jerr
fi
done
shift
done
if [ -f /tmp/jerr ]; then
echo "Errors found, outputing verifier diagnostic :"
cat /tmp/jerr
fi
# clenaup
[ -f /tmp/jout ] && rm /tmp/jout
[ -f /tmp/jerr ] && rm /tmp/jerr