test tap format

and find new cross-shell bugs in urchin!
This commit is contained in:
Thomas Levine 2016-02-28 20:03:48 +00:00
parent e0fc0356a9
commit 008d8a2829
12 changed files with 32 additions and 8 deletions

View File

@ -1,4 +0,0 @@
tmp=$(mktemp)
../../urchin -t .testsuite/ | sed 1d > $tmp
diff $tmp .expected-output

View File

@ -0,0 +1,7 @@
not ok 1 - a (sh)
# ------------ Begin output ------------
# This is stdout from a.
# ------------ End output ------------
ok 2 - b (sh)
ok 3 - c (File is not executable.) # SKIP
1..3

View File

View File

@ -0,0 +1,17 @@
./
> a
✗ sh (1 second)
 # This is stdout from a.
./
> b
✓ sh (1 second)
./
> c
(File is not executable.)
Done, took 1 second.
1 test passed.
1 test skipped.
1 test failed.


View File

@ -0,0 +1,3 @@
$TEST_SHELL ../../urchin -s sh -t .testsuite/ |
sed -e 1d -e /second/d > $tmp
diff $tmp .tap-output-expectation

3
tests/Flags/Urchin format Executable file
View File

@ -0,0 +1,3 @@
$TEST_SHELL ../../urchin -s sh .testsuite/ |
sed -e 1d -e 's/. seconds\?/1 second/' > $tmp
diff $tmp .urchin-output-expectation

View File

@ -1,2 +0,0 @@
,ok
false,not ok
1 ok
2 false not ok

4
urchin
View File

@ -314,7 +314,7 @@ report_outcome() {
printf '\033[31m'
fi
printf '%s\n' "$not_oks $(plural test "$not_oks") failed."
printf '\033[m'
printf '\033[m\n'
fi
test "$not_oks" -eq '0'
}
@ -457,7 +457,7 @@ do
shift
done
if $cycle_shell && test -f "$shell_list"; then
if ! $cycle_shell && test -f "$shell_list"; then
echo "The -n/--disable-cycling and -s/--shell options clash with each other." >&2
urchin_exit 11
fi