git.iko.soy/typeable/pandoc
on master help sign in
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

commit385dcb116c4f192416228f637a45e9a1392cd172 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateThu 14 Jan 2010, 05:54 (17 years ago) parentcc41e16
1 file changed+4−6
Setup.hs+4−6
Setup.hs+4−6
@@ -36,12 +36,10 @@ main = do
3636 exitWith ExitSuccess
3737
3838-- | Run test suite.
39−runTestSuite _ _ _ _ = do
40− tempPath <- catch getTemporaryDirectory (\_ -> return ".")
41− (outputPath, hOut) <- openTempFile tempPath "out"
42− runProcess "pandoc" ["--version"] Nothing Nothing Nothing (Just hOut) Nothing >>= waitForProcess
43− output <- readFile outputPath
44− let highlightingSupport = "with syntax highlighting" `isInfixOf` output
39+runTestSuite _ _ pkg _ = do
40+ let isHighlightingKate (Dependency (PackageName "highlighting-kate") _) = True
41+ isHighlightingKate _ = False
42+ let highlightingSupport = any isHighlightingKate $ buildDepends pkg
4543 let testArgs = if highlightingSupport then ["lhs"] else []
4644 let testCmd = "runhaskell -i.. RunTests.hs " ++ unwords testArgs
4745 inDirectory "tests" $ runCommand testCmd >>= waitForProcess >>= exitWith