Skip to content

Commit 1d5c05f

Browse files
committed
tests: Add ghcWithHoogle test
1 parent a72d2ec commit 1d5c05f

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

test/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ in {
1717
builder-haddock = haskell.callPackage ./builder-haddock {};
1818
stack-simple = haskell.callPackage ./stack-simple {};
1919
shell-for = haskell.callPackage ./shell-for {};
20+
snapshots = haskell.callPackage ./snapshots { inherit util; };
2021
callStackToNix = haskell.callPackage ./callStackToNix {};
2122
callCabalProjectToNix = haskell.callPackage ./call-cabal-project-to-nix {};
2223

test/snapshots/default.nix

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{ stdenv, util, snapshots }:
2+
3+
with stdenv.lib;
4+
with util;
5+
6+
let
7+
env = snapshots."lts-12.21".ghcWithHoogle
8+
(ps: with ps; [ conduit conduit-extra resourcet ]);
9+
10+
in
11+
stdenv.mkDerivation {
12+
name = "shell-for-test";
13+
14+
buildCommand = ''
15+
########################################################################
16+
# test snapshot ghcWithHoogle
17+
18+
printf "checking that the ghcWithPackages env has the package...\n" >& 2
19+
${env}/bin/ghc-pkg list | grep conduit
20+
21+
touch $out
22+
'';
23+
24+
meta.platforms = platforms.all;
25+
passthru = {
26+
# Used for testing externally with nix-shell (../tests.sh).
27+
# This just adds cabal-install to the existing shell.
28+
env = addCabalInstall env;
29+
};
30+
}

0 commit comments

Comments
 (0)