git.iko.soy/typeable/pandoc
on master help sign in
Made Setup.hs compatible with Cabal < 1.6.

Replaced a non-portable test for highlighting support with a portable one. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1552 788f1e2b-df1e-0410-8736-df70ead52e1b

commitbdb84bab4edc9c45c7e505709671687b7b32cb3f authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateThu 26 Feb 2009, 16:47 (18 years ago) parent75c7800
1 file changed+5−6
Setup.hs+5−6
Setup.hs+5−6
@@ -1,10 +1,7 @@
11import Distribution.Simple
2−import Distribution.Package ( pkgName )
3−import Distribution.Simple.LocalBuildInfo ( packageDeps )
4−import Distribution.PackageDescription ( emptyHookedBuildInfo )
52import Control.Exception ( bracket_ )
63import Control.Monad ( unless )
7−import System.Process ( runCommand, runProcess, waitForProcess )
4+import System.Process ( runCommand, runProcess, waitForProcess, readProcess )
85import System.FilePath ( (</>), (<.>) )
96import System.Directory
107import System.IO ( stderr )
@@ -12,6 +9,7 @@ import System.Exit
129import System.Time
1310import System.IO.Error ( isDoesNotExistError )
1411import Data.Maybe ( fromJust, isNothing, catMaybes )
12+import Data.List ( isInfixOf )
1513
1614main = do
1715 defaultMainWithHooks $ simpleUserHooks { runTests = runTestSuite
@@ -19,8 +17,9 @@ main = do
1917 exitWith ExitSuccess
2018
2119-- | Run test suite.
22−runTestSuite _ _ _ local = do
23− let highlightingSupport = (PackageName "highlighting-kate") `elem` (map pkgName $ packageDeps local)
20+runTestSuite _ _ _ _ = do
21+ vers <- readProcess ("dist" </> "build" </> "pandoc" </> "pandoc") ["--version"] ""
22+ let highlightingSupport = "+highlighting" `isInfixOf` vers
2423 let testArgs = if highlightingSupport then ["lhs"] else []
2524 let testCmd = "runhaskell -i.. RunTests.hs " ++ unwords testArgs
2625 inDirectory "tests" $ runCommand testCmd >>= waitForProcess >>= exitWith