on master help sign in
Use test.sh to generate coverage info

cabal does not work with coverage when tests are in a different package.

commitf25a1dd28e9ee7f69dea0a1634c3dd671d45cf0d authorHarendra Kumar <harendra@composewell.com> dateSun 27 Dec 2020, 19:23 (6 years ago) parent002551e
2 files changed+9−6
.circleci/config.yml+6−5 bin/test.sh+3−1
.circleci/config.yml+6−5
@@ -328,10 +328,6 @@ jobs:
328328 - *restore
329329 - run:
330330 name: Build and test with inspection, coverage, Werror
331− environment:
332− BUILD: "cabal-v2"
333− COVERALLS_OPTIONS: "--repo-token=\"$REPO_TOKEN\" --coverage-mode=StrictlyFullLines --exclude-dir=test"
334− CABAL_PROJECT: "cabal.project.coverage"
335331 command: |
336332 apt-get install -y ghc-8.10.2
337333 apt-get install -y cabal-install-3.2
@@ -339,7 +335,12 @@ jobs:
339335 apt-get install -y libcurl4-gnutls-dev
340336 apt-get install -y git
341337 apt-get install libtinfo-dev
342− bash -c "$PACKCHECK $BUILD"
338+ cabal update
339+ PATH=$HOME/.cabal/bin:$PATH
340+ export PATH
341+ which hpc-coveralls 2>/dev/null || cabal install --project-file cabal.project.coverage hpc-coveralls
342+ bin/test.sh --coverage --raw
343+ hpc-coveralls --repo-token="$REPO_TOKEN" --coverage-mode=StrictlyFullLines
343344 no_output_timeout: 25m
344345 - *save
345346 hlint-src:
bin/test.sh+3−1
@@ -35,6 +35,7 @@ set_common_vars
3535COVERAGE=
3636MEASURE=1
3737HPC_REPORT_OPTIONS=
38+RAW=0
3839
3940# XXX add a bisect option
4041while test -n "$1"
@@ -47,6 +48,7 @@ do
4748 --hpc-report-options) shift; HPC_REPORT_OPTIONS=$1; shift ;;
4849 --rtsopts) shift; RTS_OPTIONS=$1; shift ;;
4950 # flags
51+ --raw) RAW=1; shift ;;
5052 --slow) SLOW=1; shift ;;
5153 --quick) QUICK_MODE=1; shift ;;
5254 --dev-build) RUNNING_DEVBUILD=1; shift ;;
@@ -140,7 +142,7 @@ fi
140142# Run coverage reports
141143#-----------------------------------------------------------------------------
142144
143−if test "$COVERAGE" -eq "1"
145+if test "$COVERAGE" -eq "1" -a "$RAW" -eq 0
144146then
145147 TIXFILES=
146148 for i in $TARGETS