@cryptotaxi247 / kubo / commits / e1ef4d6f5

coverage_helper: log found commands

License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>

Christian Couder committed Oct 17, 2015 at 16:30 UTC e1ef4d6f54483514a18abffac7c178cb5c376580
1 file changed +12 -3
test/sharness_test_coverage_helper.sh
+12 -3
@@ -63,7 +63,9 @@ grep_out '^[^:]+:[^:]+:\s*#' expect comment "comments"
63 grep_out 'test_description=' comment desc "test_description lines"
64 grep_out '^[^:]+:[^:]+:\s*\w+="[^"]*"\s*(\&\&)?\s*$' desc def "variable definition lines"
65 grep_out '^[^:]+:[^:]+:\s*e?grep\W[^|]*\Wipfs' def grep "grep lines"
66 -grep_out '^[^:]+:[^:]+:\s*echo\W[^|]*\Wipfs' grep echo "echo lines"
66 +grep_out '^[^:]+:[^:]+:\s*cat\W[^|]*\Wipfs' grep cat "cat lines"
67 +grep_out '^[^:]+:[^:]+:\s*rmdir\W[^|]*\Wipfs' cat rmdir "rmdir lines"
68 +grep_out '^[^:]+:[^:]+:\s*echo\W[^|]*\Wipfs' cat echo "echo lines"
69
70 grep_in() {
71 pattern="$1"
@@ -131,12 +133,19 @@ do
133 fi
134 fi
135
134 - egrep "$PATTERN" "$CMD_RES" >"$CMD_OUT"
135 - reverse "$CMD_OUT" | sed -e 's/^sharness\///' | cut -d- -f1 | uniq -c >>"$GLOBAL_REV"
136 + egrep "$PATTERN" "$CMD_RES" >"$CMD_OUT.txt"
137 + reverse "$CMD_OUT.txt" | sed -e 's/^sharness\///' | cut -d- -f1 | uniq -c >>"$GLOBAL_REV"
138 echo "$NAME" >>"$GLOBAL_REV"
139 fi
140 done
141
142 +# The following will allow us to check that
143 +# we are properly excuding enough stuff using:
144 +# diff -u ipfs_cmd_result.txt cmd_found.txt
145 +log "Get all the line commands that matched"
146 +CMD_FOUND="$TMPDIR/cmd_found.txt"
147 +cat $TMPDIR/res_*.txt | sort -n | uniq >"$CMD_FOUND"
148 +
149 log "Print results"
150 reverse "$GLOBAL_REV"
151