aboutsummaryrefslogtreecommitdiff
path: root/Setup.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-11 17:36:58 -0800
committerNathan Gass <gass@search.ch>2011-01-12 11:35:10 +0100
commiteb1d0148596b91c2887233e034411763196490a5 (patch)
tree2a3ca115e319249d4edd4a17ce7327cef17406d7 /Setup.hs
parent3bc0a55af0994f34c1d7b2ebdc8b960f0f713ebf (diff)
downloadpandoc-eb1d0148596b91c2887233e034411763196490a5.tar.gz
Improvements to test suite.
+ You can now specify glob patterns after 'cabal test'; e.g. 'cabal test latex' will only run the latex tests. + Instead of detecting highlighting support in Setup.hs, we now detect it in test-pandoc, by looking to see if 'languages' is null. + We now verify the lhs readers against the lhs-test.native, normalizing with 'normalize'. This makes more sense than verifying against HTML, which also brings in the HTML writer. + Added lhsn-test.nohl.{html,html+lhs}, so we can do the lhs tests whether or not highlighting has been installed.
Diffstat (limited to 'Setup.hs')
-rw-r--r--Setup.hs11
1 files changed, 3 insertions, 8 deletions
diff --git a/Setup.hs b/Setup.hs
index 432746070..6dbc119e2 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -38,17 +38,12 @@ main = do
-- | Run test suite.
runTestSuite :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO a
-runTestSuite _ _ pkg lbi = do
+runTestSuite args _ pkg lbi = do
let testDir = buildDir lbi </> "test-pandoc"
testDir' <- canonicalizePath testDir
+ let testArgs = concatMap (\arg -> ["-t",arg]) args
if any id [buildable (buildInfo exe) | exe <- executables pkg, exeName exe == "test-pandoc"]
- then do
- let isHighlightingKate (Dependency (PackageName "highlighting-kate") _) = True
- isHighlightingKate _ = False
- let highlightingSupport = any isHighlightingKate $ buildDepends pkg
- let testArgs = if highlightingSupport then [] else ["-t", "!lhs"]
- inDirectory "tests" $ rawSystem (testDir' </> "test-pandoc")
- testArgs >>= exitWith
+ then inDirectory "tests" $ rawSystem (testDir' </> "test-pandoc") testArgs >>= exitWith
else do
putStrLn "Build pandoc with the 'tests' flag to run tests"
exitWith $ ExitFailure 3