on master help sign in
Update bin/test.sh cli help, add it to test/README.md
2131682Harendra Kumar
bin/test.sh+14−6
@@ -9,15 +9,23 @@ SCRIPT_DIR=$(dirname $0)
9print_help () {
9print_help () {
10 echo "Usage: $0 "
10 echo "Usage: $0 "
11 echo " [--targets <"target1 target2 ..." | help>]"
11 echo " [--targets <"target1 target2 ..." | help>]"
12− echo " [--slow]"
13− echo " [--quick]"
14 echo " [--cabal-build-options <option>]"
12 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>]"
15 echo " -- <hspec options or test names>"
19 echo " -- <hspec options or test names>"
16 echo
20 echo
17 echo "--targets: targets to run, use 'help' for list of targets"
21 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"
20 echo "--cabal-build-options: Pass any cabal build options to be used for build"
22 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"
21 echo
29 echo
22 echo "Any arguments after a '--' are passed directly to hspec"
30 echo "Any arguments after a '--' are passed directly to hspec"
23 exit
31 exit
@@ -49,8 +57,8 @@ do
49 --rtsopts) shift; RTS_OPTIONS=$1; shift ;;
57 --rtsopts) shift; RTS_OPTIONS=$1; shift ;;
50 # flags
58 # flags
51 --raw) RAW=1; shift ;;
59 --raw) RAW=1; shift ;;
52− --slow) SLOW=1; shift ;;
60+ #--slow) SLOW=1; shift ;; # not implemented
53− --quick) QUICK_MODE=1; shift ;;
61+ #--quick) QUICK_MODE=1; shift ;; # not implemented
54 --dev-build) RUNNING_DEVBUILD=1; shift ;;
62 --dev-build) RUNNING_DEVBUILD=1; shift ;;
55 --coverage) COVERAGE=1; shift ;;
63 --coverage) COVERAGE=1; shift ;;
56 --no-measure) MEASURE=0; shift ;;
64 --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+
1## Build a single test
18## Build a single test
2
19
3```
20```