on 19052d8 help sign in
40 lines 1.1 kB history raw
1{ stdenv, lib, stackProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
3with lib;
5let
6 project = stackProject' {
7 src = testSrc "ghc-options";
8 };
9 packages = project.hsPkgs;
11 # Get the names of all packages. This is a test to see
12 # whether there is a broken "$locals" package present.
13 hasIdentifier = p: p != null && p ? identifier;
14 packageNames = mapAttrsToList (name: p: p.identifier.name) (filterAttrs (name: hasIdentifier) packages);
16in recurseIntoAttrs {
17 # This test is somehow broken for ghcjs
18 meta.disabled = stdenv.hostPlatform.isGhcjs || compiler-nix-name != "ghc865";
20 ifdInputs = {
21 inherit (project) stack-nix;
22 };
23 run = stdenv.mkDerivation {
24 name = "callStackToNix-test";
26 buildCommand = ''
27 printf "checking whether executable runs... " >& 2
28 cat ${haskellLib.check packages.test-ghc-options.components.exes.test-ghc-options-exe}/test-stdout
30 echo '${concatStringsSep " " packageNames}' > $out
31 '';
33 meta.platforms = platforms.all;
35 passthru = {
36 # Attributes used for debugging with nix repl
37 inherit project packages;
38 };
39 };