Skip to content

Commit 6925cd3

Browse files
committed
Fix coverage test for cross compiling
1 parent 10a7fe7 commit 6925cd3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/coverage/default.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ let
2323
stackProj = (stackProject' projectArgs);
2424

2525
exeExt = stdenv.hostPlatform.extensions.executable;
26+
crossSuffix = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-${stdenv.hostPlatform.config}";
2627

2728
in recurseIntoAttrs ({
2829
# Does not work on ghcjs because it needs zlib.
@@ -89,7 +90,7 @@ in recurseIntoAttrs ({
8990
dirExists "$pkga_basedir/html/pkga-0.1.0.0"
9091
9192
pkgb_basedir="${project.hsPkgs.pkgb.coverageReport}/share/hpc/vanilla"
92-
testTix="$pkgb_basedir/tix/pkgb-test-tests-0.1.0.0-check/tests${exeExt}.tix"
93+
testTix="$pkgb_basedir/tix/pkgb-test-tests${crossSuffix}-0.1.0.0-check${crossSuffix}/tests${exeExt}.tix"
9394
libTix="$pkgb_basedir/tix/pkgb-0.1.0.0/pkgb-0.1.0.0.tix"
9495
fileExistsNonEmpty "$testTix"
9596
fileExistsNonEmpty "$libTix"
@@ -116,8 +117,8 @@ in recurseIntoAttrs ({
116117
dirExists "$project_basedir/tix/pkga-0.1.0.0"
117118
dirExists "$project_basedir/tix/pkgb-0.1.0.0"
118119
fileExistsNonEmpty "$project_basedir/tix/pkgb-0.1.0.0/pkgb-0.1.0.0.tix"
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"
120+
dirExists "$project_basedir/tix/pkgb-test-tests${crossSuffix}-0.1.0.0-check${crossSuffix}"
121+
fileExistsNonEmpty "$project_basedir/tix/pkgb-test-tests${crossSuffix}-0.1.0.0-check${crossSuffix}/tests${exeExt}.tix"
121122
'') ([cabalProj] ++ optional (compiler-nix-name == "ghc865") stackProj))}
122123
123124
touch $out

0 commit comments

Comments
 (0)