Skip to content

Commit 8897120

Browse files
committed
Fix coverage tests
1 parent e170f9a commit 8897120

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

test/coverage-no-libs/default.nix

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ let
1515

1616
# We can easily select a different compiler when using cabal,
1717
# but for stack we would need a different resolver to be used..
18-
cabalProj = (cabalProject' projectArgs // { inherit compiler-nix-name; });
18+
cabalProj = (cabalProject' (projectArgs // { inherit compiler-nix-name; }));
1919
stackProj = (stackProject' projectArgs);
2020

2121
exeExt = stdenv.hostPlatform.extensions.executable;
@@ -80,16 +80,16 @@ in recurseIntoAttrs ({
8080
8181
${concatStringsSep "\n" (map (project: ''
8282
pkga_basedir="${project.hsPkgs.pkga.coverageReport}/share/hpc/vanilla"
83-
dirExistsEmpty "$pkga_basedir/html/pkga-0.1.0.0"
84-
dirExistsEmpty "$pkga_basedir/mix/pkga-0.1.0.0"
85-
dirExistsEmpty "$pkga_basedir/tix/pkga-0.1.0.0"
83+
dirExists "$pkga_basedir/html/pkga-0.1.0.0"
84+
dirExistsEmpty "$pkga_basedir/mix"
85+
dirExists "$pkga_basedir/tix/pkga-0.1.0.0"
8686
8787
project_basedir="${project.projectCoverageReport}/share/hpc/vanilla"
88-
dirExistsEmpty "$pkga_basedir/html/pkga-0.1.0.0"
89-
dirExistsEmpty "$pkga_basedir/mix/pkga-0.1.0.0"
90-
dirExistsEmpty "$pkga_basedir/tix/pkga-0.1.0.0"
91-
dirExistsEmpty "$project_basedir/tix/all"
92-
'') (optional (compiler-nix-name == "ghc865") stackProj))}
88+
dirExists "$pkga_basedir/html/pkga-0.1.0.0"
89+
dirExistsEmpty "$pkga_basedir/mix"
90+
dirExists "$pkga_basedir/tix/pkga-0.1.0.0"
91+
dirExists "$project_basedir/tix/all"
92+
'') ([cabalProj] ++ optional (compiler-nix-name == "ghc865") stackProj))}
9393
9494
touch $out
9595
'';

test/coverage/default.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let
1919

2020
# We can easily select a different compiler when using cabal,
2121
# but for stack we would need a different resolver to be used..
22-
cabalProj = (cabalProject' projectArgs // { inherit compiler-nix-name; });
22+
cabalProj = (cabalProject' (projectArgs // { inherit compiler-nix-name; }));
2323
stackProj = (stackProject' projectArgs);
2424

2525
exeExt = stdenv.hostPlatform.extensions.executable;
@@ -85,11 +85,11 @@ in recurseIntoAttrs ({
8585
${concatStringsSep "\n" (map (project: ''
8686
pkga_basedir="${project.hsPkgs.pkga.coverageReport}/share/hpc/vanilla"
8787
findFileExistsNonEmpty "$pkga_basedir/mix/pkga-0.1.0.0/" "PkgA.mix"
88-
dirExistsEmpty "$pkga_basedir/tix/pkga-0.1.0.0"
89-
dirExistsEmpty "$pkga_basedir/html/pkga-0.1.0.0"
88+
dirExists "$pkga_basedir/tix/pkga-0.1.0.0"
89+
dirExists "$pkga_basedir/html/pkga-0.1.0.0"
9090
9191
pkgb_basedir="${project.hsPkgs.pkgb.coverageReport}/share/hpc/vanilla"
92-
testTix="$pkgb_basedir/tix/pkgb-0.1.0.0/tests${exeExt}/tests${exeExt}.tix"
92+
testTix="$pkgb_basedir/tix/pkgb-test-tests-0.1.0.0-check/tests${exeExt}.tix"
9393
libTix="$pkgb_basedir/tix/pkgb-0.1.0.0/pkgb-0.1.0.0.tix"
9494
fileExistsNonEmpty "$testTix"
9595
fileExistsNonEmpty "$libTix"
@@ -116,9 +116,9 @@ in recurseIntoAttrs ({
116116
dirExists "$project_basedir/tix/pkga-0.1.0.0"
117117
dirExists "$project_basedir/tix/pkgb-0.1.0.0"
118118
fileExistsNonEmpty "$project_basedir/tix/pkgb-0.1.0.0/pkgb-0.1.0.0.tix"
119-
dirExists "$project_basedir/tix/pkgb-0.1.0.0/tests${exeExt}"
120-
fileExistsNonEmpty "$project_basedir/tix/pkgb-0.1.0.0/tests${exeExt}/tests${exeExt}.tix"
121-
'') (optional (compiler-nix-name == "ghc865") stackProj))}
119+
dirExists "$project_basedir/tix/pkgb-test-tests-0.1.0.0-check"
120+
fileExistsNonEmpty "$project_basedir/tix/pkgb-test-tests-0.1.0.0-check/tests${exeExt}.tix"
121+
'') ([cabalProj] ++ optional (compiler-nix-name == "ghc865") stackProj))}
122122
123123
touch $out
124124
'';

0 commit comments

Comments
 (0)