From 074137a19b1472bdb6618cecda51b4802204c4a7 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Fri, 22 Feb 2013 16:53:23 +0100 Subject: 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. --- pkgs/build-support/cabal/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pkgs/build-support/cabal') 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" -- cgit 1.4.1