summary refs log tree commit diff
path: root/pkgs/build-support/cabal
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2013-02-22 16:53:23 +0100
committerPeter Simons <simons@cryp.to>2013-02-22 16:53:23 +0100
commit074137a19b1472bdb6618cecda51b4802204c4a7 (patch)
treebbb317e9e5c1099a420a52900d9567e1b9e958f3 /pkgs/build-support/cabal
parentc3a7017cb6a1fd7519b060c4e2e9ab2e2c79e5d7 (diff)
downloadnixpkgs-074137a19b1472bdb6618cecda51b4802204c4a7.tar
nixpkgs-074137a19b1472bdb6618cecda51b4802204c4a7.tar.gz
nixpkgs-074137a19b1472bdb6618cecda51b4802204c4a7.tar.bz2
nixpkgs-074137a19b1472bdb6618cecda51b4802204c4a7.tar.lz
nixpkgs-074137a19b1472bdb6618cecda51b4802204c4a7.tar.xz
nixpkgs-074137a19b1472bdb6618cecda51b4802204c4a7.tar.zst
nixpkgs-074137a19b1472bdb6618cecda51b4802204c4a7.zip
pkgs/build-support/cabal/default.nix: add support for running test suites via Cabal
Set 'doCheck = true' to enable building and running of the test suite.
Diffstat (limited to 'pkgs/build-support/cabal')
-rw-r--r--pkgs/build-support/cabal/default.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix
index a5884786b00..650807c324a 100644
--- a/pkgs/build-support/cabal/default.nix
+++ b/pkgs/build-support/cabal/default.nix
@@ -89,7 +89,8 @@
               eval "$preConfigure"
 
               ${lib.optionalString (lib.attrByPath ["jailbreak"] false self) "${jailbreakCabal}/bin/jailbreak-cabal ${self.pname}.cabal && "
-              }for i in Setup.hs Setup.lhs; do
+              }${lib.optionalString (lib.attrByPath ["doCheck"] false self)  "configureFlags+=\" --enable-test\" && "
+	      }for i in Setup.hs Setup.lhs; do
                 test -f $i && ghc --make $i
               done
 
@@ -115,7 +116,8 @@
 
               ./Setup build
 
-              export GHC_PACKAGE_PATH=$(ghc-packages)
+              ${lib.optionalString (lib.attrByPath ["doCheck"] false self)  "./Setup test && "
+	      }export GHC_PACKAGE_PATH=$(ghc-packages)
               [ -n "$noHaddock" ] || ./Setup haddock
 
               eval "$postBuild"