on master help sign in
Update bin/test.sh cli help, add it to test/README.md
commit2131682e9a4443a8fe196072e9f2cc11c5a73c24 authorHarendra Kumar <harendra@composewell.com> dateTue 9 Feb 2021, 02:24 (6 years ago) parent39ec0b6
2 files changed+31−6
bin/test.sh+14−6 test/README.md+17
bin/test.sh+14−6
@@ -9,15 +9,23 @@ SCRIPT_DIR=$(dirname $0)
99print_help () {
1010 echo "Usage: $0 "
1111 echo " [--targets <"target1 target2 ..." | help>]"
12− echo " [--slow]"
13− echo " [--quick]"
1412 echo " [--cabal-build-options <option>]"
13+ echo " [--dev-build]"
14+ echo " [--coverage]"
15+ echo " [--hpc-report-options <option>]"
16+ echo " [--no-measure]"
17+ echo " [--raw]"
18+ echo " [--rtsopts <option>]"
1519 echo " -- <hspec options or test names>"
1620 echo
1721 echo "--targets: targets to run, use 'help' for list of targets"
18− echo "--slow: take longer but run more tests"
19− echo "--quick: faster but run fewer tests"
2022 echo "--cabal-build-options: Pass any cabal build options to be used for build"
23+ echo "--dev-build: runs some additional tests"
24+ echo "--coverage: enable coverage and report coverage info"
25+ echo "--hpc-report-options: option for 'hpc report'"
26+ echo "--no-measure: with --coverage, do not run tests, only show coverage info"
27+ echo "--raw: with --coverage, do not run hpc"
28+ echo "--rtsopts: pass GHC RTS options to the test executable"
2129 echo
2230 echo "Any arguments after a '--' are passed directly to hspec"
2331 exit
@@ -49,8 +57,8 @@ do
4957 --rtsopts) shift; RTS_OPTIONS=$1; shift ;;
5058 # flags
5159 --raw) RAW=1; shift ;;
52− --slow) SLOW=1; shift ;;
53− --quick) QUICK_MODE=1; shift ;;
60+ #--slow) SLOW=1; shift ;; # not implemented
61+ #--quick) QUICK_MODE=1; shift ;; # not implemented
5462 --dev-build) RUNNING_DEVBUILD=1; shift ;;
5563 --coverage) COVERAGE=1; shift ;;
5664 --no-measure) MEASURE=0; shift ;;
test/README.md+17
@@ -1,3 +1,20 @@
1+## Using bin/test.sh
2+
3+`bin/test.sh` (path relative to the top level repo dir) can run selected
4+test groups, generate coverage report, pass GHC RTS options when
5+running tests. `test.sh` runs the tests with restricted memory, see
6+`bin/test.sh` source for details on the amount of memory used or to change it.
7+
8+To generate coverage report:
9+
10+```
11+$ bin/test.sh --coverage
12+```
13+
14+To view coverage report, open `./hpc_index.html` in browser.
15+
16+See `bin/test.sh --help` for more info.
17+
118## Build a single test
219
320```