coverage_helper: output a result
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Christian Couder committed
Oct 16, 2015 at 19:21 UTC
6291662b89655da9711617b6e12adcf584c3d26c
1 file changed
+17
-4
test/sharness_test_coverage_helper.sh
+17
-4
@@ -106,23 +106,36 @@ reverse() {
106
fi
107
}
108
109
-log "Math the test line commands with the commands they use"
109
+log "Match the test line commands with the commands they use"
110
+GLOBAL_REV="$TMPDIR/global_results_reversed.txt"
111
reverse "$CMD_CMDS" | while read -r ipfs cmd sub1 sub2
112
do
113
if test -n "$sub2"
114
then
114
- egrep "$ipfs(\W.*)*\W$cmd(\W.*)*\W$sub1(\W.*)*\W$sub2" "$CMD_RES" >"$TMPDIR/res_${ipfs}_${cmd}_${sub1}_${sub2}.txt"
115
+ CMD_OUT="$TMPDIR/res_${ipfs}_${cmd}_${sub1}_${sub2}.txt"
116
+ egrep "$ipfs(\W.*)*\W$cmd(\W.*)*\W$sub1(\W.*)*\W$sub2" "$CMD_RES" >"$CMD_OUT"
117
+ reverse "$CMD_OUT" | sed -e 's/^sharness\///' | cut -d- -f1 | uniq -c >>"$GLOBAL_REV"
118
+ echo "$ipfs $cmd $sub1 $sub2" >>"$GLOBAL_REV"
119
else
120
if test -n "$sub1"
121
then
118
- egrep "$ipfs(\W.*)*\W$cmd(\W.*)*\W$sub1" "$CMD_RES" >"$TMPDIR/res_${ipfs}_${cmd}_${sub1}.txt"
122
+ CMD_OUT="$TMPDIR/res_${ipfs}_${cmd}_${sub1}.txt"
123
+ egrep "$ipfs(\W.*)*\W$cmd(\W.*)*\W$sub1" "$CMD_RES" >"$CMD_OUT"
124
+ reverse "$CMD_OUT" | sed -e 's/^sharness\///' | cut -d- -f1 | uniq -c >>"$GLOBAL_REV"
125
+ echo "$ipfs $cmd $sub1" >>"$GLOBAL_REV"
126
else
127
if test -n "$cmd"
128
then
122
- egrep "$ipfs(\W.*)*\W$cmd" "$CMD_RES" >"$TMPDIR/res_${ipfs}_${cmd}.txt"
129
+ CMD_OUT="$TMPDIR/res_${ipfs}_${cmd}.txt"
130
+ egrep "$ipfs(\W.*)*\W$cmd" "$CMD_RES" >"$CMD_OUT"
131
+ reverse "$CMD_OUT" | sed -e 's/^sharness\///' | cut -d- -f1 | uniq -c >>"$GLOBAL_REV"
132
+ echo "$ipfs $cmd" >>"$GLOBAL_REV"
133
fi
134
fi
135
fi
136
done
137
138
+log "Print results"
139
+reverse "$GLOBAL_REV"
140
+
141
# Remove temp directory...