summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Tests/Command.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/Tests/Command.hs b/test/Tests/Command.hs
index 24e7a67d9..95fb69ef0 100644
--- a/test/Tests/Command.hs
+++ b/test/Tests/Command.hs
@@ -13,18 +13,18 @@ import Test.Tasty
import Test.Tasty.HUnit
import Tests.Helpers
import Text.Pandoc
-import Text.Pandoc.Shared (trimr)
import qualified Data.ByteString as BS
import qualified Text.Pandoc.UTF8 as UTF8
import System.IO.Unsafe (unsafePerformIO) -- TODO temporary
-- | Run a test with normalize function, return True if test passed.
runTest :: String -- ^ Title of test
+ -> FilePath -- ^ Path to pandoc
-> String -- ^ Shell command
-> String -- ^ Input text
-> String -- ^ Expected output
-> TestTree
-runTest testname cmd inp norm = testCase testname $ do
+runTest testname pandocpath cmd inp norm = testCase testname $ do
let cmd' = cmd ++ " --data-dir ../data"
let findDynlibDir [] = Nothing
findDynlibDir ("build":xs) = Just $ joinPath (reverse xs) </> "build"
@@ -35,7 +35,7 @@ runTest testname cmd inp norm = testCase testname $ do
Nothing -> []
Just d -> [("DYLD_LIBRARY_PATH", d),
("LD_LIBRARY_PATH", d)]
- let env' = dynlibEnv ++ [("TMP","."),("LANG","en_US.UTF-8"),("HOME", "./")]
+ let env' = dynlibEnv ++ [("PATH",takeDirectory pandocpath),("TMP","."),("LANG","en_US.UTF-8"),("HOME", "./")]
let pr = (shell cmd'){ env = Just env' }
(ec, out', err') <- readCreateProcessWithExitCode pr inp
-- filter \r so the tests will work on Windows machines
@@ -82,8 +82,8 @@ runCommandTest pandocpath (num, code) =
normlines = takeWhile (/=".") (drop 1 r3)
input = unlines inplines
norm = unlines normlines
- shcmd = trimr $ takeDirectory pandocpath </> cmd
- in runTest ("#" ++ show num) shcmd input norm
+ shcmd = cmd -- trimr $ takeDirectory pandocpath </> cmd
+ in runTest ("#" ++ show num) pandocpath shcmd input norm
extractCommandTest :: FilePath -> FilePath -> TestTree
extractCommandTest pandocpath fp = unsafePerformIO $ do