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

commita39865af036af7f1a03d4c9dd07e637084af8ae0 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 14 Feb 2009, 16:25 (18 years ago) parent1a15c46
2 files changed+9−4
Setup.hs+7−2 tests/RunTests.hs+2−2
Setup.hs+7−2
@@ -1,4 +1,6 @@
11import Distribution.Simple
2+import Distribution.Package ( pkgName )
3+import Distribution.Simple.LocalBuildInfo ( packageDeps )
24import Distribution.PackageDescription ( emptyHookedBuildInfo )
35import Control.Exception ( bracket_ )
46import Control.Monad ( unless )
@@ -17,8 +19,11 @@ main = do
1719 exitWith ExitSuccess
1820
1921-- | Run test suite.
20−runTestSuite _ _ _ _ = do
21− inDirectory "tests" $ runCommand "runhaskell -i.. RunTests.hs" >>= waitForProcess >>= exitWith
22+runTestSuite _ _ _ local = do
23+ let highlightingSupport = (PackageName "highlighting-kate") `elem` (map pkgName $ packageDeps local)
24+ let testArgs = if highlightingSupport then ["lhs"] else []
25+ let testCmd = "runhaskell -i.. RunTests.hs " ++ unwords testArgs
26+ inDirectory "tests" $ runCommand testCmd >>= waitForProcess >>= exitWith
2227
2328-- | Build man pages from markdown sources in man/man1/.
2429makeManPages _ _ _ _ = do
tests/RunTests.hs+2−2
@@ -99,10 +99,10 @@ main = do
9999 "testsuite.native" "testsuite.native"
100100 r12s <- if runLhsTests
101101 then mapM runLhsWriterTest lhsWriterFormats
102− else return []
102+ else putStrLn "Skipping lhs writer tests because they presuppose highlighting support" >> return []
103103 r13s <- if runLhsTests
104104 then mapM runLhsReaderTest lhsReaderFormats
105− else return []
105+ else putStrLn "Skipping lhs reader tests because they presuppose highlighting support" >> return []
106106 let results = r1s ++ [r2, r3, r4, r5, r6, r7, r7a, r8, r9, r10, r11] ++ r12s ++ r13s
107107 if all id results
108108 then do