-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_reports.sh
executable file
·51 lines (45 loc) · 1.18 KB
/
build_reports.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
#!/bin/bash
# Create the final report for each %uncertainty value and rectangle distance
# args
log_prefix=$1
u_values=(u25 u50 u75 u100)
rectangles=(001 002 004 008 016)
# -----------------------------------------------------------------------------
distance_report() {
distance=$1
echo tests category
for u in ${u_values[*]}
do
for d in `ls | grep $log_prefix`
do
tests=$(grep 'test:' $d/safehome_${u}-rectangles_${distance} | cut -d'#' -f2 | cut -d':' -f2 | awk '{count=count+$NF}END{print count}')
category=$(echo ${u} | cut -d'u' -f2)
echo $tests $category
done
done
}
uncertainty_report() {
u_value=$1
echo tests distance
for d in ${rectangles[*]}
do
for tests in $(grep ${u_value} report${d} | cut -d' ' -f1)
do
echo $tests $d
done
done
}
# execution
echo Creating tests_by_distance reports...
for r in ${rectangles[*]}
do
echo Creating report${r}
echo -e "$( distance_report $r )" > report${r}
done
echo Creating tests_by_uncertainty_degree reports...
for u in ${u_values[*]}
do
category=$(echo ${u} | cut -d'u' -f2)
echo Creating report${category}
echo -e "$( uncertainty_report $category )" > report${category}
done