3#------------------------------------------------------------------------------
5#------------------------------------------------------------------------------
7SCRIPT_DIR=$(dirname $0)
11 echo " [--targets <"target1 target2 ..." | help>]"
12 echo " [--with-compiler <compiler exe name>]"
13 echo " [--cabal-build-options <option>]"
16 echo " [--hpc-report-options <option>]"
17 echo " [--no-measure]"
19 echo " [--rtsopts <option>]"
20 echo " -- <hspec options or test names>"
22 echo "--targets: targets to run, use 'help' for list of targets"
23 echo "--cabal-build-options: Pass any cabal build options to be used for build"
24 echo "--dev-build: runs some additional tests"
25 echo "--coverage: enable coverage and report coverage info"
26 echo "--hpc-report-options: option for 'hpc report'"
27 echo "--no-measure: with --coverage, do not run tests, only show coverage info"
28 echo "--raw: with --coverage, do not run hpc"
29 echo "--rtsopts: pass GHC RTS options to the test executable"
31 echo "Any arguments after a '--' are passed directly to hspec"
35#-----------------------------------------------------------------------------
37#-----------------------------------------------------------------------------
40source $SCRIPT_DIR/build-lib.sh
49# XXX add a bisect option
53 -h|--help|help) print_help ;;
54 # options with arguments
55 --targets) shift; TARGETS=$1; shift ;;
56 --with-compiler) shift; CABAL_WITH_COMPILER=$1; shift ;;
57 --cabal-build-options) shift; CABAL_BUILD_OPTIONS=$1; shift ;;
58 --hpc-report-options) shift; HPC_REPORT_OPTIONS=$1; shift ;;
59 --rtsopts) shift; RTS_OPTIONS=$1; shift ;;
61 --raw) RAW=1; shift ;;
62 #--slow) SLOW=1; shift ;; # not implemented
63 #--quick) QUICK_MODE=1; shift ;; # not implemented
64 --dev-build) RUNNING_DEVBUILD=1; shift ;;
65 --coverage) COVERAGE=1; shift ;;
66 --no-measure) MEASURE=0; shift ;;
68 -*|--*) echo "Unknown flags: $*"; echo; print_help ;;
76#-----------------------------------------------------------------------------
78#-----------------------------------------------------------------------------
80# Requires RUNNING_DEVBUILD var
81source $SCRIPT_DIR/targets.sh
83if test "$(has_item "$TARGETS" help)" = "help"
90DEFAULT_TARGETS="$(all_grp)"
93echo "Using targets [$TARGETS]"
95#-----------------------------------------------------------------------------
97#-----------------------------------------------------------------------------
101 *) if test "$COVERAGE" -eq "1"
103 echo -n "-K8M -M1024M"
111# $2: bench executable
112target_exe_extra_args () {
117 $(test_exe_rts_opts $(basename $bench_prog)) \
122if test "$COVERAGE" -eq "1"
124 # Used to determine the hpc tix dir
125 PACKAGE_FULL_NAME=streamly-0.7.2
127 Linux) SYSTEM=x86_64-linux ;;
128 *) echo "Unsupported system"; exit 1 ;;
131 # With the --enable-coverage option the tests as well as the library get
132 # compiled with -fhpc, and we get coverage for tests as well. But we want to
133 # exclude that, so a project file is needed.
134 CABAL_BUILD_OPTIONS+=" --project-file cabal.project.coverage"
135 mkdir -p $BUILD_DIR/hpc
137BUILD_TEST="$CABAL_EXECUTABLE v2-build $CABAL_BUILD_OPTIONS --enable-tests"
139if test "$MEASURE" -eq "1"
141run_build "$BUILD_TEST" streamly-tests test "$TARGETS"
144#-----------------------------------------------------------------------------
146#-----------------------------------------------------------------------------
148if test "$MEASURE" -eq "1"
150run_targets streamly-tests t "$TARGETS" target_exe_extra_args
153#-----------------------------------------------------------------------------
154# Run coverage reports
155#-----------------------------------------------------------------------------
157if test "$COVERAGE" -eq "1" -a "$RAW" -eq 0
162 tixfile="$(get_tix_file ${i})"
163 if test -f "$tixfile"
165 TIXFILES+="$tixfile "
169 ALLTIX=$BUILD_DIR/hpc/all.tix
170 hpc sum --output=$ALLTIX $TIXFILES
171 run_verbose hpc markup $ALLTIX --hpcdir \
172 $BUILD_DIR/build/$SYSTEM/ghc-${GHC_VERSION}/streamly-0.7.2/hpc/vanilla/mix/streamly-0.7.2/
173 run_verbose hpc report $ALLTIX $HPC_REPORT_OPTIONS --hpcdir \
174 $BUILD_DIR/build/$SYSTEM/ghc-${GHC_VERSION}/streamly-0.7.2/hpc/vanilla/mix/streamly-0.7.2/
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list