@cryptotaxi247 / kubo / commits / 33c6df682

coverage_helper: get commands from 'ipfs commands'

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

Christian Couder committed Oct 16, 2015 at 17:28 UTC 33c6df6827be971969be7ed1961049d47f175ca8
1 file changed +9 -3
test/sharness_test_coverage_helper.sh
+9 -3
@@ -43,7 +43,7 @@ DATE=$(date +"%Y-%m-%dT%H:%M:%SZ")
43 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"
46 +log "Grep the sharness tests for ipfs commands"
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"
@@ -85,9 +85,15 @@ grep_in '\.ipfs.*\Wipfs\W' slash dot_in2 "\.ipfs.*ipfs"
85 grep_out '\.ipfs' slash dot ".ipfs"
86
87 log "Print result"
88 +CMD_RES="$TMPDIR/ipfs_cmd_result.txt"
89 for f in dot slash_in1 slash_in2 dot_in1 dot_in2
90 do
90 - cat "$TMPDIR/ipfs_cmd_${f}.txt"
91 -done | sort | uniq
91 + fname="$TMPDIR/ipfs_cmd_${f}.txt"
92 + cat "$fname" || die "Could not cat '$fname'"
93 +done | sort | uniq >"$CMD_RES" || die "Could not write '$CMD_RES'"
94 +
95 +log "Get all the ipfs commands from 'ipfs commands'"
96 +CMD_CMDS="$TMPDIR/commands.txt"
97 +ipfs commands >"$CMD_CMDS" || die "'ipfs commands' failed"
98
99 # Remove temp directory...