aboutsummaryrefslogtreecommitdiff
path: root/test_runner
diff options
context:
space:
mode:
authorKate Ward <kate.ward@forestent.com>2020-04-11 13:36:54 +0200
committerKate Ward <kate.ward@forestent.com>2020-04-11 13:36:54 +0200
commit80b17572a2d2c337072e4f5a7afb88493c3d3cee (patch)
tree06526303211dd18d6d53f846418f2785117d7f61 /test_runner
parent5a723f81f03f6c4f076b8a06a1f550d6a4767796 (diff)
downloadshflags-80b17572a2d2c337072e4f5a7afb88493c3d3cee.tar.gz
Pulled from upstream.
Diffstat (limited to 'test_runner')
-rwxr-xr-xtest_runner24
1 files changed, 22 insertions, 2 deletions
diff --git a/test_runner b/test_runner
index 07a423d..22aed9e 100755
--- a/test_runner
+++ b/test_runner
@@ -12,6 +12,20 @@
# This script runs all the unit tests that can be found, and generates a nice
# report of the tests.
#
+### Sample usage:
+#
+# Run all tests for all shells.
+# $ ./test_runner
+#
+# Run all tests for single shell.
+# $ ./test_runner -s /bin/bash
+#
+# Run single test for all shells.
+# $ ./test_runner -t shunit_asserts_test.sh
+#
+# Run single test for single shell.
+# $ ./test_runner -s /bin/bash -t shunit_asserts_test.sh
+#
### ShellCheck (http://www.shellcheck.net/)
# Disable source following.
# shellcheck disable=SC1090,SC1091
@@ -160,7 +174,11 @@ EOF
# ${shell_bin} needs word splitting.
# shellcheck disable=SC2086
( exec ${shell_bin} "./${t}" 2>&1; )
- test "${runner_passing_}" -eq ${RUNNER_TRUE} -a $? -eq ${RUNNER_TRUE}
+ shell_passing=$?
+ if [ "${shell_passing}" -ne "${RUNNER_TRUE}" ]; then
+ runner_warn "${shell_bin} not passing"
+ fi
+ test "${runner_passing_}" -eq ${RUNNER_TRUE} -a ${shell_passing} -eq ${RUNNER_TRUE}
runner_passing_=$?
done
done
@@ -168,4 +186,6 @@ EOF
}
# Execute main() if this is run in standalone mode (i.e. not from a unit test).
-[ -z "${SHUNIT_VERSION}" ] && main "$@"
+if [ -z "${SHUNIT_VERSION}" ]; then
+ main "$@"
+fi