@cryptotaxi247 / kubo / commits / 741c0e5e5

coverage_helper: remove more cruft

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

Christian Couder committed Oct 15, 2015 at 16:01 UTC 741c0e5e50870fa73915c29a2062ed46bfb3a3cc
1 file changed +29 -7
test/sharness_test_coverage_helper.sh
+29 -7
@@ -44,22 +44,44 @@ TMPDIR=$(mktemp -d "/tmp/coverage_helper.$DATE.XXXXXX") ||
44 die "could not 'mktemp -d /tmp/coverage_helper.$DATE.XXXXXX'"
45
46 log "Grep the sharness tests"
47 -CMDRAW="$TMPDIR/ipfs_cmd_raw.txt"
48 -git grep -E '\Wipfs\W' -- sharness/t*-*.sh >"$CMDRAW" ||
47 +CMD_RAW="$TMPDIR/ipfs_cmd_raw.txt"
48 +git grep -n -E '\Wipfs\W' -- sharness/t*-*.sh >"$CMD_RAW" ||
49 die "Could not grep ipfs in the sharness tests"
50
51 log "Remove test_expect_{success,failure} lines"
52 -CMDPROC1="$TMPDIR/ipfs_cmd_proc1.txt"
53 -egrep -v 'test_expect_.*ipfs' "$CMDRAW" >"$CMDPROC1" ||
52 +CMD_EXPECT="$TMPDIR/ipfs_cmd_expect.txt"
53 +egrep -v 'test_expect_.*ipfs' "$CMD_RAW" >"$CMD_EXPECT" ||
54 die "Could not remove test_expect_{success,failure} lines"
55
56 log "Remove comments"
57 -CMDPROC2="$TMPDIR/ipfs_cmd_proc2.txt"
58 -egrep -v '^\s*#' "$CMDPROC1" >"$CMDPROC2" ||
57 +CMD_COMMENT="$TMPDIR/ipfs_cmd_comment.txt"
58 +egrep -v '^\s*#' "$CMD_EXPECT" >"$CMD_COMMENT" ||
59 die "Could not remove comments"
60
61 +log "Remove test_description lines"
62 +CMD_DESC="$TMPDIR/ipfs_cmd_description.txt"
63 +egrep -v 'test_description=' "$CMD_COMMENT" >"$CMD_DESC" ||
64 +die "Could not remove test_description lines"
65 +
66 +log "Remove echos lines"
67 +CMD_ECHO="$TMPDIR/ipfs_cmd_echo.txt"
68 +egrep -v '\Wecho\s[^|]*ipfs' "$CMD_DESC" >"$CMD_ECHO" ||
69 +die "Could not remove echo lines"
70 +
71 +
72 +
73 +log "Keep ipfs.*/ipfs/"
74 +CMD_IPFS_OK="$TMPDIR/ipfs_cmd_ipfs_ok.txt"
75 +egrep '\Wipfs\W.*/ipfs/' "$CMD_ECHO" >"$CMD_IPFS_OK" ||
76 +die "Could not keep 'ipfs.*/ipfs/'"
77 +
78 +log "Remove /ipfs/"
79 +CMD_SLASH="$TMPDIR/ipfs_cmd_slash_ipfs.txt"
80 +egrep -v '/ipfs/' "$CMD_ECHO" >"$CMD_SLASH" ||
81 +die "Could not remove /ipfs/"
82 +
83
84 log "Print result"
63 -cat "$CMDPROC2"
85 +cat "$CMD_SLASH" "$CMD_IPFS_OK" | sort
86
87 # Remove temp directory...