-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalyse.sh
executable file
·131 lines (110 loc) · 2.28 KB
/
analyse.sh
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/bash
versions=" \
1.0.1 \
1.0.2 \
1.0.3 \
1.1.0 \
1.2.0 \
1.2.1 \
1.2.2 \
1.3.0 \
1.3.1 \
1.3.2 \
1.4.0 \
1.4.1 \
1.4.2 \
1.5.0 \
1.6.0 \
1.7.0 \
1.7.1 \
1.7.2 \
1.7.3 \
1.7.4 \
1.8.0 \
1.8.1 \
1.8.2 \
1.9.0 \
1.10.0 \
1.11.0 \
1.12.0 \
1.12.1 \
1.13.0 \
1.14.0 \
1.15.0 \
1.15.1 \
1.16.0 \
1.16.1 \
1.16.2 \
1.17.0 \
1.17.1 \
1.18.0 \
1.18.1 \
1.18.2 \
1.19.0 \
1.20.0 \
1.20.1 \
1.21.0 \
1.21.1 \
1.21.2 \
1.21.3 \
1.21.4 \
1.21.5 \
2.0.0 \
2.0.1 \
2.1.0 \
2.2.0 \
2.2.1 \
2.2.2 \
2.2.3 \
2.2.4 \
2.2.5 \
2.3.0 \
2.3.4 \
v2.3.1 \
v2.3.2 \
v2.3.3 \
v2.4.1 \
v2.4.2 \
v2.4.3 \
v2.4.4 \
v2.4.5 \
v2.5.0 \
v2.5.1 \
v2.5.2 \
v2.5.3"
outfolder=./report/data/
for target in jsapi all
do
file=./results/eval/violations-$target.txt
outfile=$outfolder/violations-$target.txt
culfile=$outfolder/cumulative-$target.txt
rm -f $outfile $culfile
collector=`mktemp -t coll`
for version in $versions
do
collectorNext=`mktemp -t coll`
violations=`mktemp -t viol-$version`
breaking=`mktemp -t breaking-$version`
features=`mktemp -t features-$version`
grep "V$version" "$file" > "$violations"
echo "$version $violations"
grep -E "^[^,]+,[^,]+,$version" "$violations" | sed "s/^[^'\"]*,//" | sort > "$features"
grep -E "^[^,]+,$version" "$violations" | sed "s/^[^'\"]*,//" | sort > "$breaking"
breaking_viol=`wc -l "$breaking" | awk '{print $1}'`
features_viol=`wc -l "$features" | awk '{print $1}'`
sort -m "$breaking" "$features" "$collector" | uniq >"$collectorNext"
cumulative=`cat "$collectorNext" | uniq | wc -l | awk '{print $1}'`
collector="$collectorNext"
#uniq_breaking_viol=`uniq "$breaking" | wc -l | awk '{print $1}'`
#uniq_feature_viol=`uniq "$features" | wc -l | awk '{print $1}'`
echo "$version $breaking_viol $features_viol $((features_viol + breaking_viol))" >> $outfile
echo "$version $cumulative" >> "$culfile"
done
python2.7 unwrapper <$collector >results/cumulative-$target.txt
done
join $outfolder/violations-jsapi.txt \
$outfolder/violations-all.txt \
>$outfolder/combined-violations.txt
join $outfolder/cumulative-jsapi.txt \
$outfolder/cumulative-all.txt \
>$outfolder/combined-cumulative.txt