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 CABAL_BUILD_OPTIONS=""
141 CABAL_EXECUTABLE=cabal
143 # Use branch specific builds if git-cabal is present in PATH
144 BUILD_DIR=dist-newstyle
145 if test "$USE_GIT_CABAL" -eq 1
147 if which git-cabal 2>/dev/null
149 echo "Using git-cabal for branch specific builds"
150 CABAL_EXECUTABLE=git-cabal
151 BUILD_DIR=$(git-cabal show-builddir)
156# To be called after parsing CLI arguments
158 if test -n "$CABAL_WITH_COMPILER"
160 CABAL_BUILD_OPTIONS+=" --with-compiler $CABAL_WITH_COMPILER"
162 CABAL_WITH_COMPILER=ghc
165 GHC_VERSION=$($CABAL_WITH_COMPILER --numeric-version)
168# XXX cabal issue "cabal v2-exec which" cannot find benchmark/test executables
172# $3: component ("" (lib), t (test), b (benchmark), x (executable))
174cabal_which_builddir() {
175 local path=$(echo $1/build/*/ghc-${GHC_VERSION}/${2}-0.0.0/$3/$4/build/$4/$4)
176 test -f "$path" && echo $path
183 cabal_which_builddir $BUILD_DIR $1 $2 $3
188# $3: component prefix
193 local component_prefix=$3
199 COMPONENTS+="$package:$component_prefix:$c "
201 run_verbose $build_prog $COMPONENTS || die "build failed"
206 echo $BUILD_DIR/build/$SYSTEM/ghc-${GHC_VERSION}/$PACKAGE_FULL_NAME/hpc/vanilla/tix/$1/$1.tix
212# $4: args generator func
214 local package_name=$1
220 target_prog=$(cabal_target_prog $package_name $component $target_name) || \
221 die "Cannot find executable for target $target_name"
223 echo "Running executable $target_name ..."
225 # Needed by bench-exec-one.sh
226 export BENCH_EXEC_PATH=$target_prog
227 mkdir -p $(dirname $(get_tix_file $target_name))
228 export HPCTIXFILE=$(get_tix_file $target_name)
230 run_verbose $target_prog $($extra_args $target_name $target_prog) \
231 || die "Target exe failed"
233 # hpc-coveralls fails if there is an empty dir and no .tix file generated
234 rmdir $(dirname $(get_tix_file $target_name)) 2>/dev/null || true
240# $4: args generator func
244 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