Additional documentation for test scripts
Added documentation in comments in test scripts, added example site.sh, moved evaluation of site.sh later in lib.sh to allow site.sh to override more lib.sh variables.
This commit is contained in:
parent
40da4421e6
commit
e6899cc3f5
5 changed files with 95 additions and 31 deletions
24
test/all.sh
24
test/all.sh
|
|
@ -1,13 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
# Run, eg as:
|
||||
# ./all.sh 2>&1 | tee test.log # break on first test
|
||||
# Run test_*.sh tests, stop on error, verbose logging, no pass/fail summary.
|
||||
#
|
||||
# This script requires the user to be in the sudo group.
|
||||
#
|
||||
# The 'pattern' variable determines which test files to execute.
|
||||
# By default, run all the tests in the test_*.sh files in this directory.
|
||||
|
||||
# Pattern to run tests, default is all, but you may want to narrow it down
|
||||
: ${pattern:=test_*.sh}
|
||||
|
||||
# You can specify tests files to exclude using the 'SKIPLIST' variable in a
|
||||
# site.sh file. See example in README.md. Files excluded by the 'SKIPLIST'
|
||||
# variable have precedence over files included by the 'pattern' variable.
|
||||
|
||||
# This script does not take arguments, so if arguments exist, print the Usage
|
||||
# in http://docopt.org/ format.
|
||||
if [ $# -gt 0 ]; then
|
||||
echo "usage: $0 # detailed logs and stop on first error. Use pattern=\"\" $0 to"
|
||||
echo " Use pattern=<pattern> $0 to narrow down test cases"
|
||||
echo "Usage:"
|
||||
echo " $0 # Run all 'test_*.sh' files"
|
||||
echo " pattern=<Bash glob pattern> $0 # Run only files matching the pattern"
|
||||
echo ""
|
||||
echo "Example:"
|
||||
echo " ${0} 2>&1 | tee test.log # Run all tests, output to 'test.log'"
|
||||
echo " pattern=test_feature.sh ${0} # Run only the tests in 'test_feature.sh'"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue