Skip to content

Commit a8bbe63

Browse files
committed
Refactor test filtering
1 parent 390a0f0 commit a8bbe63

File tree

11 files changed

+24
-20
lines changed

11 files changed

+24
-20
lines changed

test/cabal-22/default.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ let
1111
packages = project.hsPkgs;
1212

1313
in recurseIntoAttrs {
14+
# When using ghcjs on darwin this test fails with
15+
# ReferenceError: h$hs_clock_darwin_gettime is not defined
16+
# https://github.com/input-output-hk/haskell.nix/issues/925
17+
meta.disabled = stdenv.hostPlatform.isGhcjs;
1418
ifdInputs = {
1519
inherit (project) plan-nix;
1620
};

test/coverage-golden/default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ let
1919
exampleCoverageReport = exampleProject.cardanoShellHaskellPackages.projectCoverageReport;
2020

2121
in recurseIntoAttrs ({
22+
# Does not work on ghcjs because it needs zlib.
23+
meta.disabled = stdenv.hostPlatform.isGhcjs;
2224
run = stdenv.mkDerivation {
2325
name = "coverage-golden-test";
2426

test/coverage-no-libs/default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ let
2020
exeExt = stdenv.hostPlatform.extensions.executable;
2121

2222
in recurseIntoAttrs ({
23+
# Does not work on ghcjs because it needs zlib.
24+
meta.disabled = stdenv.hostPlatform.isGhcjs;
2325
run = stdenv.mkDerivation {
2426
name = "coverage-test";
2527

test/coverage/default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ let
2424
exeExt = stdenv.hostPlatform.extensions.executable;
2525

2626
in recurseIntoAttrs ({
27+
# Does not work on ghcjs because it needs zlib.
28+
meta.disabled = stdenv.hostPlatform.isGhcjs;
2729
run = stdenv.mkDerivation {
2830
name = "coverage-test";
2931

test/default.nix

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -192,28 +192,16 @@ let
192192
index-state = callTest ./index-state { inherit compiler-nix-name; };
193193
lookup-sha256 = callTest ./lookup-sha256 { inherit compiler-nix-name; };
194194
# fully-static = callTest ./fully-static { inherit (pkgs) buildPackages; };
195-
196-
unit = unitTests;
197-
} // lib.optionalAttrs (!stdenv.hostPlatform.isGhcjs && !stdenv.hostPlatform.isWindows) {
198-
# Does not work on ghcjs because it needs zlib.
199-
# Does not work on windows because it needs mintty.
200195
shell-for = callTest ./shell-for {};
201-
} // lib.optionalAttrs (!stdenv.hostPlatform.isGhcjs) {
202-
# When using ghcjs on darwin this test fails with
203-
# ReferenceError: h$hs_clock_darwin_gettime is not defined
204-
# https://github.com/input-output-hk/haskell.nix/issues/925
205196
cabal-22 = callTest ./cabal-22 { inherit util compiler-nix-name; };
206-
# These do not work on ghcjs because it needs zlib.
207197
coverage = callTest ./coverage { inherit compiler-nix-name; };
208198
coverage-golden = callTest ./coverage-golden { inherit compiler-nix-name;};
209199
coverage-no-libs = callTest ./coverage-no-libs { inherit compiler-nix-name; };
210200
snapshots = callTest ./snapshots {};
211-
} // lib.optionalAttrs (!pkgs.haskell-nix.haskellLib.isCrossHost) {
212-
# Haddock is not included with cross compilers currently
213201
sublib-docs = callTest ./sublib-docs { inherit util compiler-nix-name; };
214-
# githash runs git from TH code and this needs a cross compiled git exe
215-
# to work correctly. Cross compiling git is currently brocken.
216202
githash = haskell-nix.callPackage ./githash { inherit compiler-nix-name; testSrc = testSrcWithGitDir; };
203+
204+
unit = unitTests;
217205
};
218206

219207
# This is the same as allTests, but filter out all the key/vaules from the

test/githash/default.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ let
4242
packages.githash-test.components.exes.githash-test;
4343

4444
in recurseIntoAttrs {
45-
meta.disabled = compiler-nix-name == "ghc901";
45+
# githash runs git from TH code and this needs a cross compiled git exe
46+
# to work correctly. Cross compiling git is currently brocken.
47+
meta.disabled = compiler-nix-name == "ghc901" || pkgs.haskell-nix.haskellLib.isCrossHost;
4648

4749
ifdInputs = {
4850
inherit (project) plan-nix;

test/haskell-language-server/cabal.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ in recurseIntoAttrs {
88
build = project.getComponent "haskell-language-server:exe:haskell-language-server";
99

1010
# Haskell Language Server does not build for GHC 9 yet
11-
meta.disabled = builtins.compareVersions
12-
buildPackages.haskell-nix.compiler.${compiler-nix-name}.version "9.0" >= 0;
11+
meta.disabled = compiler-nix-name == "ghc901";
1312
}

test/haskell-language-server/stack.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@ in recurseIntoAttrs {
2525
build = project.hsPkgs.haskell-language-server.components.exes.haskell-language-server;
2626

2727
# Haskell Language Server does not build for GHC 9 yet
28-
meta.disabled = builtins.compareVersions
29-
buildPackages.haskell-nix.compiler.${compiler-nix-name}.version "9.0" >= 0;
28+
meta.disabled = compiler-nix-name == "ghc901";
3029
}

test/shell-for/default.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ let
5151
};
5252

5353
in recurseIntoAttrs {
54+
# Does not work on ghcjs because it needs zlib.
55+
# Does not work on windows because it needs mintty.
56+
meta.disabled = stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isGhcjs || stdenv.hostPlatform.isWindows;
5457
inherit env envPkga envDefault;
5558
run = stdenv.mkDerivation {
5659
name = "shell-for-test";
@@ -72,7 +75,6 @@ in recurseIntoAttrs {
7275

7376
meta = {
7477
platforms = platforms.unix;
75-
disabled = stdenv.hostPlatform.isMusl;
7678
};
7779

7880
passthru = {

test/snapshots/default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ let
77
(ps: with ps; [ conduit conduit-extra resourcet ]);
88

99
in recurseIntoAttrs {
10+
# Does not work on ghcjs because it needs zlib.
11+
meta.disabled = stdenv.hostPlatform.isGhcjs;
1012
inherit env;
1113
run = stdenv.mkDerivation {
1214
name = "shell-for-test";

test/sublib-docs/default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ let
1212
packages = project.hsPkgs;
1313

1414
in recurseIntoAttrs {
15+
# Haddock is not included with cross compilers currently
16+
meta.disabled = pkgs.haskell-nix.haskellLib.isCrossHost;
1517
ifdInputs = {
1618
inherit (project) plan-nix;
1719
};

0 commit comments

Comments
 (0)