3#------------------------------------------------------------------------------
5#------------------------------------------------------------------------------
7SCRIPT_DIR=$(dirname $0)
11 echo " [--targets <"target1 target2 ..." | help>]"
14 echo " [--cabal-build-options <option>]"
15 echo " -- <hspec options or test names>"
17 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 "Any arguments after a '--' are passed directly to hspec"
26#-----------------------------------------------------------------------------
28#-----------------------------------------------------------------------------
31source $SCRIPT_DIR/build-lib.sh
40# XXX add a bisect option
44 -h|--help|help) print_help ;;
45 # options with arguments
46 --targets) shift; TARGETS=$1; shift ;;
47 --cabal-build-options) shift; CABAL_BUILD_OPTIONS=$1; shift ;;
48 --hpc-report-options) shift; HPC_REPORT_OPTIONS=$1; shift ;;
49 --rtsopts) shift; RTS_OPTIONS=$1; shift ;;
51 --raw) RAW=1; shift ;;
52 --slow) SLOW=1; shift ;;
53 --quick) QUICK_MODE=1; shift ;;
54 --dev-build) RUNNING_DEVBUILD=1; shift ;;
55 --coverage) COVERAGE=1; shift ;;
56 --no-measure) MEASURE=0; shift ;;
58 -*|--*) echo "Unknown flags: $*"; echo; print_help ;;
64#-----------------------------------------------------------------------------
66#-----------------------------------------------------------------------------
68# Requires RUNNING_DEVBUILD var
69source $SCRIPT_DIR/targets.sh
71if test "$(has_item "$TARGETS" help)" = "help"
78DEFAULT_TARGETS="$(all_grp)"
81echo "Using targets [$TARGETS]"
83#-----------------------------------------------------------------------------
85#-----------------------------------------------------------------------------
89 *) if test "$COVERAGE" -eq "1"
91 echo -n "-K8M -M1024M"
100target_exe_extra_args () {
105 $(test_exe_rts_opts $(basename $bench_prog)) \
110if test "$COVERAGE" -eq "1"
112 # Used to determine the hpc tix dir
113 PACKAGE_FULL_NAME=streamly-0.7.2
115 Linux) SYSTEM=x86_64-linux ;;
116 *) echo "Unsupported system"; exit 1 ;;
119 # With the --enable-coverage option the tests as well as the library get
120 # compiled with -fhpc, and we get coverage for tests as well. But we want to
121 # exclude that, so a project file is needed.
122 CABAL_BUILD_OPTIONS+=" --project-file cabal.project.coverage"
123 mkdir -p $BUILD_DIR/hpc
125BUILD_TEST="$CABAL_EXECUTABLE v2-build $CABAL_BUILD_OPTIONS --enable-tests"
127if test "$MEASURE" -eq "1"
129run_build "$BUILD_TEST" streamly-tests test "$TARGETS"
132#-----------------------------------------------------------------------------
134#-----------------------------------------------------------------------------
136if test "$MEASURE" -eq "1"
138run_targets streamly-tests t "$TARGETS" target_exe_extra_args
141#-----------------------------------------------------------------------------
142# Run coverage reports
143#-----------------------------------------------------------------------------
145if test "$COVERAGE" -eq "1" -a "$RAW" -eq 0
150 tixfile="$(get_tix_file ${i})"
151 if test -f "$tixfile"
153 TIXFILES+="$tixfile "
157 ALLTIX=$BUILD_DIR/hpc/all.tix
158 hpc sum --output=$ALLTIX $TIXFILES
159 run_verbose hpc markup $ALLTIX --hpcdir \
160 $BUILD_DIR/build/$SYSTEM/ghc-${GHC_VERSION}/streamly-0.7.2/hpc/vanilla/mix/streamly-0.7.2/
161 run_verbose hpc report $ALLTIX $HPC_REPORT_OPTIONS --hpcdir \
162 $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