From 385dcb116c4f192416228f637a45e9a1392cd172 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Thu, 14 Jan 2010 05:54:24 +0000 Subject: 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 --- Setup.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'Setup.hs') 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 -- cgit v1.2.3