From acbb4a5e46f01d15ff1b7082d574b624bb22d1b1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 26 Jul 2012 09:43:27 -0700 Subject: 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. --- Setup.hs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'Setup.hs') 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 -- cgit v1.2.3