aboutsummaryrefslogtreecommitdiff
path: root/Setup.hs
diff options
context:
space:
mode:
authorClare Macrae <github@cfmacrae.fastmail.co.uk>2014-06-29 19:22:31 +0100
committerClare Macrae <github@cfmacrae.fastmail.co.uk>2014-06-29 19:22:31 +0100
commit717e16660d1ee83f690b35d0aa9b60c8ac9d6b61 (patch)
treeaa850d4ee99fa0b14da9ba0396ba6aa67e2037e3 /Setup.hs
parentfccfc8429cf4d002df37977f03508c9aae457416 (diff)
parentce69021e42d7bf50deccba2a52ed4717f6ddac10 (diff)
downloadpandoc-717e16660d1ee83f690b35d0aa9b60c8ac9d6b61.tar.gz
Merge remote-tracking branch 'jgm/master' into dokuwiki
Diffstat (limited to 'Setup.hs')
-rw-r--r--Setup.hs28
1 files changed, 25 insertions, 3 deletions
diff --git a/Setup.hs b/Setup.hs
index 4245df203..c1c3f6472 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,16 +1,34 @@
{-# LANGUAGE CPP #-}
+{-
+Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+-}
import Distribution.Simple
import Distribution.Simple.PreProcess
import Distribution.Simple.Setup
- (copyDest, copyVerbosity, fromFlag, installVerbosity, BuildFlags(..))
+ (copyDest, copyVerbosity, fromFlag, installVerbosity, BuildFlags(..),
+ TestFlags(..))
import Distribution.PackageDescription (PackageDescription(..), Executable(..))
import Distribution.Simple.LocalBuildInfo
(LocalBuildInfo(..), absoluteInstallDirs)
import Distribution.Verbosity ( Verbosity, silent )
-import Distribution.Simple.InstallDirs (mandir, CopyDest (NoCopyDest))
+import Distribution.Simple.InstallDirs (mandir, CopyDest (NoCopyDest), toPathTemplate)
import Distribution.Simple.Utils (installOrdinaryFiles, info)
-import Prelude hiding (catch)
+import Distribution.Simple.Test (test)
import System.Process ( rawSystem )
import System.FilePath ( (</>) )
import System.Directory ( findExecutable )
@@ -20,6 +38,10 @@ main :: IO ()
main = do
defaultMainWithHooks $ simpleUserHooks {
postBuild = makeManPages
+ , testHook = \pkg lbi _ flags ->
+ -- pass build directory as first argument to test program
+ test pkg lbi flags{ testOptions =
+ toPathTemplate (buildDir lbi) : testOptions flags }
, postCopy = \ _ flags pkg lbi ->
installManpages pkg lbi (fromFlag $ copyVerbosity flags)
(fromFlag $ copyDest flags)