@@ -13,25 +13,32 @@ source $SCRIPT_DIR/targets.sh
13print_help () {
13print_help () {
14 echo "Usage: $0 "
14 echo "Usage: $0 "
15 echo " [--targets <"target1 target2 ..." | help>]"
15 echo " [--targets <"target1 target2 ..." | help>]"
16 echo " [--with-compiler <compiler exe name>]"
18 echo " [--with-compiler <compiler exe name>]"
17 echo " [--cabal-build-options <option>]"
19 echo " [--cabal-build-options <option>]"
18 echo " [--dev-build]"
20 echo " [--dev-build]"
19 echo " [--coverage]"
22 echo " [--coverage]"
20 echo " [--hpc-report-options <option>]"
23 echo " [--hpc-report-options <option>]"
21 echo " [--no-measure]"
24 echo " [--no-measure]"
22 echo " [--raw]"
25 echo " [--raw]"
23 echo " [--rtsopts <option>]"
27 echo " [--rtsopts <option>]"
24 echo " -- <hspec options or test names>"
28 echo " -- <hspec options or test names>"
26 echo "--targets: targets to run, use 'help' for list of targets"
30 echo "--targets: targets to run, use 'help' for list of targets"
32+ echo "--quick: disable optimizations to build quickly"
27 echo "--cabal-build-options: Pass any cabal build options to be used for build"
33 echo "--cabal-build-options: Pass any cabal build options to be used for build"
28 echo "--dev-build: runs some additional tests"
34 echo "--dev-build: runs some additional tests"
29 echo "--coverage: enable coverage and report coverage info"
36 echo "--coverage: enable coverage and report coverage info"
30 echo "--hpc-report-options: option for 'hpc report'"
37 echo "--hpc-report-options: option for 'hpc report'"
31 echo "--no-measure: with --coverage, do not run tests, only show coverage info"
38 echo "--no-measure: with --coverage, do not run tests, only show coverage info"
32 echo "--raw: with --coverage, do not run hpc"
39 echo "--raw: with --coverage, do not run hpc"
33− echo "--rtsopts: pass GHC RTS options to the test executable"
41+ echo "--rtsopts: pass GHC RTS options to the test executable"
35 echo "Any arguments after a '--' are passed directly to hspec"
42 echo "Any arguments after a '--' are passed directly to hspec"
@@ -65,7 +72,7 @@ do
66 --raw) RAW=1; shift ;;
73 --raw) RAW=1; shift ;;
67 #--slow) SLOW=1; shift ;; # not implemented
74 #--slow) SLOW=1; shift ;; # not implemented
68− #--quick) QUICK_MODE=1; shift ;; # not implemented
75+ --quick) TEST_QUICK_MODE=1; shift ;;
69 --dev-build) RUNNING_DEVBUILD=1 CABAL_BUILD_OPTIONS+=" --flag dev"; shift ;;
76 --dev-build) RUNNING_DEVBUILD=1 CABAL_BUILD_OPTIONS+=" --flag dev"; shift ;;
70 --coverage) COVERAGE=1; shift ;;
77 --coverage) COVERAGE=1; shift ;;
71 --no-measure) MEASURE=0; shift ;;
78 --no-measure) MEASURE=0; shift ;;
@@ -78,6 +85,11 @@ TARGET_EXE_ARGS=$*
79set_derived_vars
86set_derived_vars
88+if test "$TEST_QUICK_MODE" -eq 1
90+ CABAL_BUILD_OPTIONS+=" --disable-optimization --flags -opt"
81#-----------------------------------------------------------------------------
93#-----------------------------------------------------------------------------
82# Determine targets
94# Determine targets
83#-----------------------------------------------------------------------------
95#-----------------------------------------------------------------------------
@@ -174,6 +186,7 @@ run_target () {
174 local extra_args=$4
186 local extra_args=$4
176 local target_prog
188 local target_prog
177 target_prog=$(cabal_target_prog $package_name $component $target_name) || \
190 target_prog=$(cabal_target_prog $package_name $component $target_name) || \
178 die "Cannot find executable for target $target_name"
191 die "Cannot find executable for target $target_name"