Compare commits
1 Commits
remove-urc
...
stop-on-fa
Author | SHA1 | Date | |
---|---|---|---|
|
27b5e88bde |
@@ -1,2 +0,0 @@
|
|||||||
Totally different syntax and similar features, plus TAP output
|
|
||||||
https://github.com/sstephenson/bats
|
|
@@ -6,7 +6,7 @@ for shell in dash bash ksh zsh; do
|
|||||||
if which $shell > /dev/null 2> /dev/null; then
|
if which $shell > /dev/null 2> /dev/null; then
|
||||||
echo
|
echo
|
||||||
echo Running urchin tests in $shell
|
echo Running urchin tests in $shell
|
||||||
$shell urchin -s $shell tests | tail -n 3
|
$shell urchin tests | tail -n 3
|
||||||
else
|
else
|
||||||
echo
|
echo
|
||||||
echo Skipping $shell because it is not in the PATH
|
echo Skipping $shell because it is not in the PATH
|
||||||
|
@@ -172,9 +172,3 @@ It might make sense if you do this.
|
|||||||
## Alternatives to Urchin
|
## Alternatives to Urchin
|
||||||
Alternatives to Urchin are discussed in
|
Alternatives to Urchin are discussed in
|
||||||
[this blog post](https://blog.scraperwiki.com/2012/12/how-to-test-shell-scripts/).
|
[this blog post](https://blog.scraperwiki.com/2012/12/how-to-test-shell-scripts/).
|
||||||
|
|
||||||
## Ideas for new features
|
|
||||||
|
|
||||||
* Support [Nagios plugins](https://nagios-plugins.org/doc/guidelines.html)
|
|
||||||
* Stop running if a test fails so one can use Urchin as a
|
|
||||||
[setup framework](https://github.com/tlevine/urchin/issues/16).
|
|
||||||
|
3
tests/urchin -x should start the $TEST_SHELL.
Executable file
3
tests/urchin -x should start the $TEST_SHELL.
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
test c = $(../urchin -x .print-arg-3 a 'b b b b' c d e)
|
9
urchin
9
urchin
@@ -112,6 +112,10 @@ $USAGE
|
|||||||
Go to https://github.com/tlevine/urchin for documentation on writing tests.
|
Go to https://github.com/tlevine/urchin for documentation on writing tests.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
# [Experimental -x option left undocumented for now.]
|
||||||
|
# -x [Experimental; not meant for direct invocation, but for use in
|
||||||
|
# the shebang line of test scripts]
|
||||||
|
# Run with "\$TEST_SHELL", falling back on /bin/sh.
|
||||||
}
|
}
|
||||||
|
|
||||||
plural () {
|
plural () {
|
||||||
@@ -179,6 +183,11 @@ do
|
|||||||
shell_for_sh_tests=$1
|
shell_for_sh_tests=$1
|
||||||
which "$shell_for_sh_tests" >/dev/null || { echo "Cannot find specified shell: '$shell_for_sh_tests'" >&2; urchin_help >&2; exit 2; }
|
which "$shell_for_sh_tests" >/dev/null || { echo "Cannot find specified shell: '$shell_for_sh_tests'" >&2; urchin_help >&2; exit 2; }
|
||||||
;;
|
;;
|
||||||
|
-x) # [EXPERIMENTAL; UNDOCUMENTED FOR NOW] `urchin -x <test-script>` in a test script's shebang line is equivalent to invoking that script with `"$TEST_SHELL" <test-script>`
|
||||||
|
shift
|
||||||
|
urchinsh=${TEST_SHELL:-/bin/sh}
|
||||||
|
"$urchinsh" "$@"
|
||||||
|
exit $?;;
|
||||||
-h|--help) urchin_help
|
-h|--help) urchin_help
|
||||||
exit 0;;
|
exit 0;;
|
||||||
-*) urchin_help >&2
|
-*) urchin_help >&2
|
||||||
|
Reference in New Issue
Block a user