Skip to content

Commit a22591b

Browse files
committed
Fix coverage test for stack project
1 parent e50feb3 commit a22591b

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

test/coverage/default.nix

+11-7
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ in recurseIntoAttrs ({
8282
fi
8383
}
8484
85-
${concatStringsSep "\n" (map (project: ''
85+
${let check = project: inplaceSuffix: ''
8686
pkga_basedir="${project.hsPkgs.pkga.coverageReport}/share/hpc/vanilla"
8787
findFileExistsNonEmpty $pkga_basedir/mix/pkga-0.1.0.0* "PkgA.mix"
8888
dirExists "$pkga_basedir/tix/pkga-0.1.0.0"
@@ -106,19 +106,23 @@ in recurseIntoAttrs ({
106106
107107
project_basedir="${project.projectCoverageReport}/share/hpc/vanilla"
108108
fileExistsNonEmpty "$project_basedir/html/index.html"
109-
dirExists "$project_basedir/html/pkga-0.1.0.0-inplace"
110-
dirExists "$project_basedir/html/pkgb-0.1.0.0-inplace"
109+
dirExists "$project_basedir/html/pkga-0.1.0.0${inplaceSuffix}"
110+
dirExists "$project_basedir/html/pkgb-0.1.0.0${inplaceSuffix}"
111111
findFileExistsNonEmpty "$project_basedir/mix/" "PkgA.mix"
112112
findFileExistsNonEmpty "$project_basedir/mix/" "PkgB.mix"
113113
findFileExistsNonEmpty "$project_basedir/mix/" "ConduitExample.mix"
114114
dirExists "$project_basedir/tix/all"
115115
fileExistsNonEmpty "$project_basedir/tix/all/all.tix"
116-
dirExists "$project_basedir/tix/pkga-0.1.0.0-inplace"
117-
dirExists "$project_basedir/tix/pkgb-0.1.0.0-inplace"
118-
fileExistsNonEmpty "$project_basedir/tix/pkgb-0.1.0.0-inplace/pkgb-0.1.0.0-inplace.tix"
116+
dirExists "$project_basedir/tix/pkga-0.1.0.0${inplaceSuffix}"
117+
dirExists "$project_basedir/tix/pkgb-0.1.0.0${inplaceSuffix}"
118+
fileExistsNonEmpty "$project_basedir/tix/pkgb-0.1.0.0${inplaceSuffix}/pkgb-0.1.0.0${inplaceSuffix}.tix"
119119
dirExists "$project_basedir/tix/pkgb-test-tests${crossSuffix}-0.1.0.0-check${crossSuffix}"
120120
fileExistsNonEmpty "$project_basedir/tix/pkgb-test-tests${crossSuffix}-0.1.0.0-check${crossSuffix}/tests${exeExt}.tix"
121-
'') ([cabalProj] ++ optional (compiler-nix-name == "ghc984") stackProj))}
121+
'';
122+
in ''
123+
${check cabalProj "-inplace"}
124+
${optionalString (compiler-nix-name == "ghc984") (check stackProj "")}
125+
''}
122126
123127
touch $out
124128
'';

0 commit comments

Comments
 (0)