on iko/ghcjs-patch-master help sign in
Add test for using GHC directly (#1049)
041435eMichael Peyton Jones
test/with-packages/default.nix+20−9
@@ -1,4 +1,4 @@
1−{ stdenv, lib, util, mkPkgSet, recurseIntoAttrs, testSrc }:
1+{ stdenv, lib, numactl, util, mkPkgSet, recurseIntoAttrs, testSrc }:
2
2
3with lib;
3with lib;
4with util;
4with util;
@@ -33,6 +33,7 @@ let
33
33
34 pkgId = p: "${p.identifier.name}-${p.identifier.version}";
34 pkgId = p: "${p.identifier.name}-${p.identifier.version}";
35 showDepends = component: concatMapStringsSep " " pkgId (component.depends or []);
35 showDepends = component: concatMapStringsSep " " pkgId (component.depends or []);
36+ extraFlags = if stdenv.isLinux then "-L${numactl}/lib" else "";
36
37
37in recurseIntoAttrs {
38in recurseIntoAttrs {
38 # Used for testing externally with nix-shell (../tests.sh).
39 # Used for testing externally with nix-shell (../tests.sh).
@@ -47,7 +48,9 @@ in recurseIntoAttrs {
47 decLibraryDepends = showDepends (pkgSet true).config.packages.test-with-packages.components.library;
48 decLibraryDepends = showDepends (pkgSet true).config.packages.test-with-packages.components.library;
48 libraryDepends = showDepends (pkgSet false).config.packages.test-with-packages.components.library;
49 libraryDepends = showDepends (pkgSet false).config.packages.test-with-packages.components.library;
49
50
50− buildCommand = ''
51+ src = ./.;
52+
53+ buildPhase = ''
51 ########################################################################
54 ########################################################################
52 # test with-packages
55 # test with-packages
53
56
@@ -71,17 +74,25 @@ in recurseIntoAttrs {
71 printf "runghc tests are not working yet for windows or ghcjs. skipping. " >& 2
74 printf "runghc tests are not working yet for windows or ghcjs. skipping. " >& 2
72 ''
75 ''
73 else ''
76 else ''
74− printf "checking that non doExactConfig liarary.env has the dependencies... " >& 2
77+ echo "checking that non doExactConfig library.env has the dependencies... "
78+ echo "with runghc"
75− ${library.env}/bin/${library.env.targetPrefix}runghc ${./Point.hs}
79+ ${library.env}/bin/${library.env.targetPrefix}runghc ./Point.hs
76− echo >& 2
80+ echo "with ghc"
77−
81+ ${library.env}/bin/${library.env.targetPrefix}ghc ${toString extraFlags} Point.hs 1> /dev/null
82+ ./Point
83+
78− printf "checking that doExactConfig library.env has the dependencies... " >& 2
84+ echo "checking that doExactConfig library.env has the dependencies... "
85+ echo "with runghc"
79− ${decLibrary.env}/bin/${decLibrary.env.targetPrefix}runghc ${./Point.hs}
86+ ${decLibrary.env}/bin/${decLibrary.env.targetPrefix}runghc ./Point.hs
80− echo >& 2
87+ echo "with ghc"
88+ ${decLibrary.env}/bin/${decLibrary.env.targetPrefix}ghc ${extraFlags} Point.hs 1> /dev/null
89+ ./Point
81 '') + ''
90 '') + ''
82 touch $out
91 touch $out
83 '';
92 '';
84
93
94+ dontInstall = true;
95+
85 meta = {
96 meta = {
86 platforms = platforms.all;
97 platforms = platforms.all;
87 disabled = stdenv.hostPlatform.isMusl;
98 disabled = stdenv.hostPlatform.isMusl;