forked from ArathaJS/aratha
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun-tests
executable file
·43 lines (41 loc) · 1.01 KB
/
run-tests
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
#!/bin/bash
DIR=`dirname $(readlink -f "$0")`
if
[[ `which nyc` ]]
then
NYC=nyc
else
NYC=$DIR/node_modules/nyc/bin/nyc.js
fi
TDIR=$DIR/benchmarks/examples
JAL=$DIR/src/js/commands/jalangi.js
N_TESTS=29
COV=(NaN 37.5 75 75 100 100 100 88.89 83.33 100 100 80 100 100 66.67 100 100 \
66.67 100 100 100 100 100 85.71 100 100 100 100 100 100)
ERR=err.log
for (( i=1; i<=$N_TESTS; i++ ))
do
j=$TDIR/example"$i".js
echo "Testing $j"
SOLVER=$1 INCREMENTAL=0 node $JAL --analysis ./ $j >/dev/null 2>$ERR
cat $ERR
ilog=`basename $j | awk -F"." '{print $1}'`.inputlog.json
mv inputlog.json $ilog
echo "===== INPUT ===== "
cat $ilog
$NYC node $DIR/bin/replay-inputs.js $j 2>/dev/null | strings | \
grep ' '`basename "$j"` | awk -F"|" '{print $5}' | sed 's/ //g' > x
cov=`cat x`
rm x $ilog $TDIR/*_jalangi_*
echo "Coverage: $cov%"
echo "Expected: ${COV[$i]}%"
if
[[ "$cov" != "${COV[$i]}" ]]
then
echo "Error!"
exit 1
else
echo -e "All good!\n=========\n"
fi
done
rm $ERR