aboutsummaryrefslogtreecommitdiff
path: root/Setup.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-07-26 09:43:27 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2012-07-26 09:43:27 -0700
commitacbb4a5e46f01d15ff1b7082d574b624bb22d1b1 (patch)
tree46eaa4acf504eb6d7dfcac5434387300533518f7 /Setup.hs
parentc414a08bcf4a4ae6c9c8007e27b87122217cdcee (diff)
downloadpandoc-acbb4a5e46f01d15ff1b7082d574b624bb22d1b1.tar.gz
Integrated test suite with cabal.
To run tests, configure with --enable-tests, then 'cabal test'. You can specify particular tests using --test-options='-t markdown'. No output is shown unless tests fail. In the future, we can move to the detailed-1.0 interface.
Diffstat (limited to 'Setup.hs')
-rw-r--r--Setup.hs15
1 files changed, 1 insertions, 14 deletions
diff --git a/Setup.hs b/Setup.hs
index a45281367..6d039823e 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -24,8 +24,7 @@ import Data.List ( (\\) )
main :: IO ()
main = do
defaultMainWithHooks $ simpleUserHooks {
- runTests = runTestSuite
- , postBuild = makeManPages
+ postBuild = makeManPages
, postCopy = \ _ flags pkg lbi ->
installManpages pkg lbi (fromFlag $ copyVerbosity flags)
(fromFlag $ copyDest flags)
@@ -34,18 +33,6 @@ main = do
}
exitWith ExitSuccess
--- | Run test suite.
-runTestSuite :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO a
-runTestSuite args _ pkg lbi = do
- let testDir = buildDir lbi </> "test-pandoc"
- testDir' <- canonicalizePath testDir
- let testArgs = "--timeout=5" : concatMap (\arg -> ["-t",arg]) args
- if any id [buildable (buildInfo exe) | exe <- executables pkg, exeName exe == "test-pandoc"]
- then inDirectory "tests" $ rawSystem (testDir' </> "test-pandoc") testArgs >>= exitWith
- else do
- putStrLn "Build pandoc with the 'tests' flag to run tests"
- exitWith $ ExitFailure 3
-
-- | Build man pages from markdown sources in man/
makeManPages :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
makeManPages _ flags _ lbi = do