summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-01-14 05:54:24 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-01-14 05:54:24 +0000
commit385dcb116c4f192416228f637a45e9a1392cd172 (patch)
treea37d99794fa84b6b37081ad42c228f9db7cf3911
parentcc41e1628546dfe76a5c94ebbe5ea7e363631176 (diff)
Setup.hs: improved detection of highlighting support in test hook.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1808 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r--Setup.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/Setup.hs b/Setup.hs
index 0f9d5ac28..1b27bad44 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -36,12 +36,10 @@ main = do
exitWith ExitSuccess
-- | Run test suite.
-runTestSuite _ _ _ _ = do
- tempPath <- catch getTemporaryDirectory (\_ -> return ".")
- (outputPath, hOut) <- openTempFile tempPath "out"
- runProcess "pandoc" ["--version"] Nothing Nothing Nothing (Just hOut) Nothing >>= waitForProcess
- output <- readFile outputPath
- let highlightingSupport = "with syntax highlighting" `isInfixOf` output
+runTestSuite _ _ pkg _ = do
+ let isHighlightingKate (Dependency (PackageName "highlighting-kate") _) = True
+ isHighlightingKate _ = False
+ let highlightingSupport = any isHighlightingKate $ buildDepends pkg
let testArgs = if highlightingSupport then ["lhs"] else []
let testCmd = "runhaskell -i.. RunTests.hs " ++ unwords testArgs
inDirectory "tests" $ runCommand testCmd >>= waitForProcess >>= exitWith