projects
/
python_utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5e1bced
)
Fixup test runner.
author
Scott Gasch
<
[email protected]
>
Thu, 23 Sep 2021 15:31:49 +0000
(08:31 -0700)
committer
Scott Gasch
<
[email protected]
>
Thu, 23 Sep 2021 15:31:49 +0000
(08:31 -0700)
tests/run_tests.sh
patch
|
blob
|
history
diff --git
a/tests/run_tests.sh
b/tests/run_tests.sh
index 9623f1b2f1a12dcfebf2a207d36a2ea6faad27ca..6c418a2424c52dcfa293f09de52fbb00e4570ed8 100755
(executable)
--- a/
tests/run_tests.sh
+++ b/
tests/run_tests.sh
@@
-37,6
+37,18
@@
make_header() {
echo
}
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"
while [[ $# -gt 0 ]]; do
key="$1"
@@
-56,22
+68,20
@@
while [[ $# -gt 0 ]]; do
INTEGRATION=1
;;
*) # unknown option
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 "Argument $key was not recognized."
+ echo
+ usage
exit 1
;;
esac
shift
done
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})
if [ ${DOCTEST} -eq 1 ]; then
for doctest in $(grep -lR doctest ${ROOT}/*.py); do
BASE=$(basename ${doctest})