summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2021-09-23 08:31:49 -0700
committerScott Gasch <[email protected]>2021-09-23 08:31:49 -0700
commit075c18063826d36377aa8d46fba66f71fcf37d20 (patch)
tree5089603677fe67883d37a7c5ae86dc7cbbc6ec09 /tests
parent5e1bced276766fec9d4c408790c99d4a26d267e0 (diff)
Fixup test runner.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/run_tests.sh28
1 files changed, 19 insertions, 9 deletions
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 9623f1b..6c418a2 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -37,6 +37,18 @@ make_header() {
echo
}
+function usage() {
+ echo "Usage: $0 [-a]|[-i][-u][-d]"
+ echo
+ echo "Runs tests under ${ROOT}. Options control which test types:"
+ echo
+ echo " -a | --all . . . . . . . . . . . . Run all types of tests"
+ echo " -d | --doctests . . . . . . . . . Run doctests"
+ echo " -u | --unittests . . . . . . . . . Run unittests"
+ echo " -i | --integration . . . . . . . . Run integration tests"
+ echo
+ exit 1
+}
while [[ $# -gt 0 ]]; do
key="$1"
@@ -56,22 +68,20 @@ while [[ $# -gt 0 ]]; do
INTEGRATION=1
;;
*) # unknown option
- echo "Usage: $0 [-a]|[-i][-u][-d]"
- echo
- echo "Runs tests under ${ROOT}. Options control which test types:"
- echo
- echo " -a | --all . . . . . . . . . . . . Run all types of tests"
- echo " -d | --doctests . . . . . . . . . Run doctests"
- echo " -u | --unittests . . . . . . . . . Run unittests"
- echo " -i | --integration . . . . . . . . Run integration tests"
- echo
echo "Argument $key was not recognized."
+ echo
+ usage
exit 1
;;
esac
shift
done
+if [ $(expr ${DOCTEST} + ${UNITTEST} + ${INTEGRATION}) -eq 0 ]; then
+ usage
+ exit 2
+fi
+
if [ ${DOCTEST} -eq 1 ]; then
for doctest in $(grep -lR doctest ${ROOT}/*.py); do
BASE=$(basename ${doctest})