11
11
# argument. Use a larger list of libraries if you would like the tests
12
12
# of one local package to generate coverage for another.
13
13
, mixLibraries ? [ library ]
14
- # hack for project-less projects
15
- , ghc ? library . project . pkg-set . config . ghc . package
16
14
} :
17
15
18
16
let
24
22
srcDirs = map ( l : l . src . outPath ) mixLibraries ;
25
23
26
24
in pkgs . runCommand ( name + "-coverage-report" )
27
- ( { buildInputs = [ ghc ] ;
28
- passthru = {
25
+ ( { passthru = {
29
26
inherit name library checks ;
30
27
} ;
31
28
# HPC will fail if the Haskell file contains non-ASCII characters,
@@ -39,14 +36,16 @@ in pkgs.runCommand (name + "-coverage-report")
39
36
LOCALE_ARCHIVE = "${ pkgs . buildPackages . glibcLocales } /lib/locale/locale-archive" ;
40
37
} )
41
38
''
39
+ local hpc=${ pkgs . targetPackages . haskellPackages . ghc } /bin/hpc
40
+
42
41
function markup() {
43
42
local -n srcDs=$1
44
43
local -n mixDs=$2
45
44
local -n includedModules=$3
46
45
local destDir=$4
47
46
local tixFile=$5
48
47
49
- local hpcMarkupCmd=("hpc" "markup" "--destdir=$destDir")
48
+ local hpcMarkupCmd=("$ hpc" "markup" "--destdir=$destDir")
50
49
for srcDir in "'' ${srcDs[@]}"; do
51
50
hpcMarkupCmd+=("--srcdir=$srcDir")
52
51
done
@@ -70,7 +69,7 @@ in pkgs.runCommand (name + "-coverage-report")
70
69
local -n tixFs=$2
71
70
local outFile="$3"
72
71
73
- local hpcSumCmd=("hpc" "sum" "--union" "--output=$outFile")
72
+ local hpcSumCmd=("$ hpc" "sum" "--union" "--output=$outFile")
74
73
75
74
for module in "'' ${includedModules[@]}"; do
76
75
hpcSumCmd+=("--include=$module")
0 commit comments