test exit codes
This commit is contained in:
parent
7ab322923a
commit
5aa081f1df
@ -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
|
||||
|
@ -1 +0,0 @@
|
||||
../../urchin .test > /dev/null
|
1
tests/Exit codes/.test/This test fails
Executable file
1
tests/Exit codes/.test/This test fails
Executable file
@ -0,0 +1 @@
|
||||
false
|
0
tests/Exit codes/.test/This test skips
Normal file
0
tests/Exit codes/.test/This test skips
Normal file
1
tests/Exit codes/0 when all tests pass
Executable file
1
tests/Exit codes/0 when all tests pass
Executable file
@ -0,0 +1 @@
|
||||
$TEST_SHELL ../../urchin '.test/This test passes'
|
1
tests/Exit codes/0 when all tests skip
Executable file
1
tests/Exit codes/0 when all tests skip
Executable file
@ -0,0 +1 @@
|
||||
$TEST_SHELL ../../urchin '.test/This test skips'
|
2
tests/Exit codes/1 when any test fails
Executable file
2
tests/Exit codes/1 when any test fails
Executable file
@ -0,0 +1,2 @@
|
||||
$TEST_SHELL ../../urchin '.test/This test passes'
|
||||
test $? -eq 1
|
2
tests/Exit codes/11 on argument errors
Executable file
2
tests/Exit codes/11 on argument errors
Executable file
@ -0,0 +1,2 @@
|
||||
$TEST_SHELL ../../urchin --not-a-flag
|
||||
test $? -eq 11
|
4
urchin
4
urchin
@ -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"
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user