aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Setup.hs9
-rw-r--r--tests/RunTests.hs4
2 files changed, 9 insertions, 4 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
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