3 >&2 echo -e "Error: $1"
8function run_verbose() {
24#------------------------------------------------------------------------------
26#------------------------------------------------------------------------------
29 if test -n "$RUNNING_TESTS"
36 if test -n "$RUNNING_BENCHMARKS"
43 if test -n "$RUNNING_DEVBUILD"
49# A group consisting of all known individual targets
51 { for i in $GROUP_TARGETS
53 for j in $(eval "echo \$$i")
58 for i in $INDIVIDUAL_TARGETS
72 echo "Individual targets:"
81list_target_groups () {
82 echo "All Targets: all_grp"
84 for i in $(all_target_groups)
99 for i in $(echo $TARGETS)
102 *_grp) eval "echo -n \$${i}" ;;
103 *_cmp) eval "echo -n \$${i} $i" ;;
111# We run the benchmarks in isolation in a separate process so that different
112# benchmarks do not interfere with other. To enable that we need to pass the
113# benchmark exe path to gauge as an argument. Unfortunately it cannot find its
116# The path is dependent on the architecture and cabal version.
121cabal_target_prog () {
122 local target_prog=`cabal_which $1 $2 $3`
123 if test -x "$target_prog"
140 GHC_VERSION=$(ghc --numeric-version)
142 CABAL_BUILD_OPTIONS=""
143 CABAL_EXECUTABLE=cabal
145 # Use branch specific builds if git-cabal is present in PATH
146 BUILD_DIR=dist-newstyle
147 if test "$USE_GIT_CABAL" -eq 1
149 if which git-cabal 2>/dev/null
151 echo "Using git-cabal for branch specific builds"
152 CABAL_EXECUTABLE=git-cabal
153 BUILD_DIR=$(git-cabal show-builddir)
158# XXX cabal issue "cabal v2-exec which" cannot find benchmark/test executables
162# $3: component ("" (lib), t (test), b (benchmark), x (executable))
164cabal_which_builddir() {
165 local path=$(echo $1/build/*/ghc-${GHC_VERSION}/${2}-0.0.0/$3/$4/build/$4/$4)
166 test -f "$path" && echo $path
173 cabal_which_builddir $BUILD_DIR $1 $2 $3
178# $3: component prefix
183 local component_prefix=$3
189 COMPONENTS+="$package:$component_prefix:$c "
191 run_verbose $build_prog $COMPONENTS || die "build failed"
196 echo $BUILD_DIR/build/$SYSTEM/ghc-${GHC_VERSION}/$PACKAGE_FULL_NAME/hpc/vanilla/tix/$1/$1.tix
202# $4: args generator func
204 local package_name=$1
210 target_prog=$(cabal_target_prog $package_name $component $target_name) || \
211 die "Cannot find executable for target $target_name"
213 echo "Running executable $target_name ..."
215 # Needed by bench-exec-one.sh
216 export BENCH_EXEC_PATH=$target_prog
217 mkdir -p $(dirname $(get_tix_file $target_name))
218 export HPCTIXFILE=$(get_tix_file $target_name)
220 run_verbose $target_prog $($extra_args $target_name $target_prog) \
221 || die "Target exe failed"
223 # hpc-coveralls fails if there is an empty dir and no .tix file generated
224 rmdir $(dirname $(get_tix_file $target_name)) 2>/dev/null || true
230# $4: args generator func
234 run_target $1 $2 $i $4
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