1111# argument. Use a larger list of libraries if you would like the tests
1212# of one local package to generate coverage for another.
1313, mixLibraries ? [ library ]
14- # hack for project-less projects
15- , ghc ? library . project . pkg-set . config . ghc . package
1614} :
1715
1816let
2422 srcDirs = map ( l : l . src . outPath ) mixLibraries ;
2523
2624in pkgs . runCommand ( name + "-coverage-report" )
27- ( { buildInputs = [ ghc ] ;
28- passthru = {
25+ ( { passthru = {
2926 inherit name library checks ;
3027 } ;
3128 # HPC will fail if the Haskell file contains non-ASCII characters,
@@ -39,14 +36,16 @@ in pkgs.runCommand (name + "-coverage-report")
3936 LOCALE_ARCHIVE = "${ pkgs . buildPackages . glibcLocales } /lib/locale/locale-archive" ;
4037 } )
4138 ''
39+ local hpc=${ pkgs . targetPackages . haskellPackages . ghc } /bin/hpc
40+
4241 function markup() {
4342 local -n srcDs=$1
4443 local -n mixDs=$2
4544 local -n includedModules=$3
4645 local destDir=$4
4746 local tixFile=$5
4847
49- local hpcMarkupCmd=("hpc" "markup" "--destdir=$destDir")
48+ local hpcMarkupCmd=("$ hpc" "markup" "--destdir=$destDir")
5049 for srcDir in "'' ${srcDs[@]}"; do
5150 hpcMarkupCmd+=("--srcdir=$srcDir")
5251 done
@@ -70,7 +69,7 @@ in pkgs.runCommand (name + "-coverage-report")
7069 local -n tixFs=$2
7170 local outFile="$3"
7271
73- local hpcSumCmd=("hpc" "sum" "--union" "--output=$outFile")
72+ local hpcSumCmd=("$ hpc" "sum" "--union" "--output=$outFile")
7473
7574 for module in "'' ${includedModules[@]}"; do
7675 hpcSumCmd+=("--include=$module")
0 commit comments