aboutsummaryrefslogtreecommitdiff
path: root/Setup.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-02-14 16:25:39 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-02-14 16:25:39 +0000
commita39865af036af7f1a03d4c9dd07e637084af8ae0 (patch)
tree1a2865932bd4eaa6aac5abaf74ee2a062d9ce8c6 /Setup.hs
parent1a15c46eef0a10387324595ebcee497835380e2c (diff)
downloadpandoc-a39865af036af7f1a03d4c9dd07e637084af8ae0.tar.gz
Check to see if highlighting supported and run lhs tests if it is.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1542 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Setup.hs')
-rw-r--r--Setup.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Setup.hs b/Setup.hs
index 03185dacd..ae259b80a 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,4 +1,6 @@
import Distribution.Simple
+import Distribution.Package ( pkgName )
+import Distribution.Simple.LocalBuildInfo ( packageDeps )
import Distribution.PackageDescription ( emptyHookedBuildInfo )
import Control.Exception ( bracket_ )
import Control.Monad ( unless )
@@ -17,8 +19,11 @@ main = do
exitWith ExitSuccess
-- | Run test suite.
-runTestSuite _ _ _ _ = do
- inDirectory "tests" $ runCommand "runhaskell -i.. RunTests.hs" >>= waitForProcess >>= exitWith
+runTestSuite _ _ _ local = do
+ let highlightingSupport = (PackageName "highlighting-kate") `elem` (map pkgName $ packageDeps local)
+ let testArgs = if highlightingSupport then ["lhs"] else []
+ let testCmd = "runhaskell -i.. RunTests.hs " ++ unwords testArgs
+ inDirectory "tests" $ runCommand testCmd >>= waitForProcess >>= exitWith
-- | Build man pages from markdown sources in man/man1/.
makeManPages _ _ _ _ = do