diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-08-14 13:02:34 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-08-14 13:03:26 -0700 |
commit | 38578ad06cca916cefebe11066622b7e60f305e8 (patch) | |
tree | cad667468407fa2b32b48301d59cc935ddd708fe /test/Tests/Command.hs | |
parent | ceda566a5ef1f1ae07ecdc7883702190d3cf1406 (diff) |
Test fixes so we can find data files.
In old tests & command tests, we now set the environment variable
pandoc_datadir.
In lua tests, we set the datadir explicitly.
Diffstat (limited to 'test/Tests/Command.hs')
-rw-r--r-- | test/Tests/Command.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/Tests/Command.hs b/test/Tests/Command.hs index 95fb69ef0..608b00b18 100644 --- a/test/Tests/Command.hs +++ b/test/Tests/Command.hs @@ -25,7 +25,6 @@ runTest :: String -- ^ Title of test -> String -- ^ Expected output -> TestTree 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" findDynlibDir (_:xs) = findDynlibDir xs @@ -35,8 +34,8 @@ runTest testname pandocpath cmd inp norm = testCase testname $ do Nothing -> [] Just d -> [("DYLD_LIBRARY_PATH", d), ("LD_LIBRARY_PATH", d)] - let env' = dynlibEnv ++ [("PATH",takeDirectory pandocpath),("TMP","."),("LANG","en_US.UTF-8"),("HOME", "./")] - let pr = (shell cmd'){ env = Just env' } + let env' = dynlibEnv ++ [("PATH",takeDirectory pandocpath),("TMP","."),("LANG","en_US.UTF-8"),("HOME", "./"),("pandoc_datadir", "..")] + let pr = (shell cmd){ env = Just env' } (ec, out', err') <- readCreateProcessWithExitCode pr inp -- filter \r so the tests will work on Windows machines let out = filter (/= '\r') $ err' ++ out' |