on master help sign in
Support hpc-coveralls for coverage upload
002551eHarendra Kumar
bin/bench.sh+1
@@ -256,6 +256,7 @@ run_reports() {
256
256
257cd $SCRIPT_DIR/..
257cd $SCRIPT_DIR/..
258
258
259+USE_GIT_CABAL=1
259set_common_vars
260set_common_vars
260
261
261DEFAULT_FIELDS="allocated bytescopied cputime"
262DEFAULT_FIELDS="allocated bytescopied cputime"
bin/build-lib.sh+14−5
@@ -147,11 +147,14 @@ set_common_vars () {
147
147
148 # Use branch specific builds if git-cabal is present in PATH
148 # Use branch specific builds if git-cabal is present in PATH
149 BUILD_DIR=dist-newstyle
149 BUILD_DIR=dist-newstyle
150− if which git-cabal 2>/dev/null
150+ if test "$USE_GIT_CABAL" -eq 1
151 then
151 then
152+ if which git-cabal 2>/dev/null
153+ then
152− echo "Using git-cabal for branch specific builds"
154+ echo "Using git-cabal for branch specific builds"
153− CABAL_EXECUTABLE=git-cabal
155+ CABAL_EXECUTABLE=git-cabal
154− BUILD_DIR=$(git-cabal show-builddir)
156+ BUILD_DIR=$(git-cabal show-builddir)
157+ fi
155 fi
158 fi
156}
159}
157
160
@@ -191,6 +194,11 @@ run_build () {
191 run_verbose $build_prog $COMPONENTS || die "build failed"
194 run_verbose $build_prog $COMPONENTS || die "build failed"
192}
195}
193
196
197+# $1: target name
198+get_tix_file () {
199+ echo $BUILD_DIR/build/$SYSTEM/ghc-${GHC_VERSION}/$PACKAGE_FULL_NAME/hpc/vanilla/tix/$1/$1.tix
200+}
201+
194# $1: package name
202# $1: package name
195# $2: component
203# $2: component
196# $3: target
204# $3: target
@@ -209,7 +217,8 @@ run_target () {
209
217
210 # Needed by bench-exec-one.sh
218 # Needed by bench-exec-one.sh
211 export BENCH_EXEC_PATH=$target_prog
219 export BENCH_EXEC_PATH=$target_prog
220+ mkdir -p $(dirname $(get_tix_file $target_name))
212− export HPCTIXFILE=$BUILD_DIR/coverage/$target_name.tix
221+ export HPCTIXFILE=$(get_tix_file $target_name)
213
222
214 run_verbose $target_prog $($extra_args $target_name $target_prog) \
223 run_verbose $target_prog $($extra_args $target_name $target_prog) \
215 || die "Target exe failed"
224 || die "Target exe failed"
bin/test.sh+11−8
@@ -30,6 +30,7 @@ print_help () {
30RUNNING_TESTS=y
30RUNNING_TESTS=y
31source $SCRIPT_DIR/build-lib.sh
31source $SCRIPT_DIR/build-lib.sh
32
32
33+USE_GIT_CABAL=1
33set_common_vars
34set_common_vars
34COVERAGE=
35COVERAGE=
35MEASURE=1
36MEASURE=1
@@ -106,11 +107,18 @@ target_exe_extra_args () {
106
107
107if test "$COVERAGE" -eq "1"
108if test "$COVERAGE" -eq "1"
108then
109then
110+ # Used to determine the hpc tix dir
111+ PACKAGE_FULL_NAME=streamly-0.7.2
112+ case `uname` in
113+ Linux) SYSTEM=x86_64-linux ;;
114+ *) echo "Unsupported system"; exit 1 ;;
115+ esac
116+
109 # With the --enable-coverage option the tests as well as the library get
117 # With the --enable-coverage option the tests as well as the library get
110 # compiled with -fhpc, and we get coverage for tests as well. But we want to
118 # compiled with -fhpc, and we get coverage for tests as well. But we want to
111 # exclude that, so a project file is needed.
119 # exclude that, so a project file is needed.
112 CABAL_BUILD_OPTIONS+=" --project-file cabal.project.coverage"
120 CABAL_BUILD_OPTIONS+=" --project-file cabal.project.coverage"
113− mkdir -p $BUILD_DIR/coverage
121+ mkdir -p $BUILD_DIR/hpc
114fi
122fi
115BUILD_TEST="$CABAL_EXECUTABLE v2-build $CABAL_BUILD_OPTIONS --enable-tests"
123BUILD_TEST="$CABAL_EXECUTABLE v2-build $CABAL_BUILD_OPTIONS --enable-tests"
116
124
@@ -137,15 +145,10 @@ then
137 TIXFILES=
145 TIXFILES=
138 for i in $TARGETS
146 for i in $TARGETS
139 do
147 do
140− TIXFILES+="$BUILD_DIR/coverage/${i}.tix "
148+ TIXFILES+="$(get_tix_file ${i}) "
141 done
149 done
142
150
143− case `uname` in
144− Linux) SYSTEM=x86_64-linux ;;
145− *) echo "Unsupported system"; exit 1 ;;
146− esac
147−
148− ALLTIX=$BUILD_DIR/coverage/all.tix
151+ ALLTIX=$BUILD_DIR/hpc/all.tix
149 hpc sum --output=$ALLTIX $TIXFILES
152 hpc sum --output=$ALLTIX $TIXFILES
150 run_verbose hpc markup $ALLTIX --hpcdir \
153 run_verbose hpc markup $ALLTIX --hpcdir \
151 $BUILD_DIR/build/$SYSTEM/ghc-${GHC_VERSION}/streamly-0.7.2/hpc/vanilla/mix/streamly-0.7.2/
154 $BUILD_DIR/build/$SYSTEM/ghc-${GHC_VERSION}/streamly-0.7.2/hpc/vanilla/mix/streamly-0.7.2/