@@ -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