test exit codes

This commit is contained in:
Thomas Levine 2016-02-28 20:56:21 +00:00
parent 7ab322923a
commit 5aa081f1df
10 changed files with 11 additions and 14 deletions

View File

@ -1,13 +0,0 @@
#!/bin/sh
# Borrow this test which has a failure in it (3 in fact), and
# run it using urchin:
../../urchin "../Counts should be kept of successes and failures./.test" > /dev/null
# Now invert the result, we want _this_ test to fail if the exit
# code was 0.
case $? in
0) exit 8;;
*) exit 0;;
esac

View File

@ -1 +0,0 @@
../../urchin .test > /dev/null

View File

@ -0,0 +1 @@
false

View File

View File

@ -0,0 +1 @@
$TEST_SHELL ../../urchin '.test/This test passes'

View File

@ -0,0 +1 @@
$TEST_SHELL ../../urchin '.test/This test skips'

View File

@ -0,0 +1,2 @@
$TEST_SHELL ../../urchin '.test/This test passes'
test $? -eq 1

View File

@ -0,0 +1,2 @@
$TEST_SHELL ../../urchin --not-a-flag
test $? -eq 11

4
urchin
View File

@ -444,6 +444,10 @@ do
}
validate_strings "$shell_for_sh_tests" 'Shell paths'
if echo "$shell_for_sh_tests" | grep \ > /dev/null; then
echo "Warning: It is best if shell paths contain no spaces so that
you don't need to quote the TEST_SHELL variable." > /dev/stderr
fi
echo "$shell_for_sh_tests" >> "$shell_list"
;;