diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-02-14 16:25:39 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-02-14 16:25:39 +0000 |
commit | a39865af036af7f1a03d4c9dd07e637084af8ae0 (patch) | |
tree | 1a2865932bd4eaa6aac5abaf74ee2a062d9ce8c6 | |
parent | 1a15c46eef0a10387324595ebcee497835380e2c (diff) | |
download | pandoc-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
-rw-r--r-- | Setup.hs | 9 | ||||
-rw-r--r-- | tests/RunTests.hs | 4 |
2 files changed, 9 insertions, 4 deletions
@@ -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 diff --git a/tests/RunTests.hs b/tests/RunTests.hs index ead4e450a..90e2276b2 100644 --- a/tests/RunTests.hs +++ b/tests/RunTests.hs @@ -99,10 +99,10 @@ main = do "testsuite.native" "testsuite.native" r12s <- if runLhsTests then mapM runLhsWriterTest lhsWriterFormats - else return [] + else putStrLn "Skipping lhs writer tests because they presuppose highlighting support" >> return [] r13s <- if runLhsTests then mapM runLhsReaderTest lhsReaderFormats - else return [] + else putStrLn "Skipping lhs reader tests because they presuppose highlighting support" >> return [] let results = r1s ++ [r2, r3, r4, r5, r6, r7, r7a, r8, r9, r10, r11] ++ r12s ++ r13s if all id results then do |