diff options
author | Lila <lila91142@gmail.com> | 2020-05-19 07:46:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-18 22:46:14 -0700 |
commit | c04800305e97a42d2d346fc6b0425817056438b7 (patch) | |
tree | 70d433a976ed162980cd08ffeece3c84d1ad3b8a /test/Tests/Old.hs | |
parent | f4185fcef0aa5c00e37a1bf8bbc8b8c6459fffe7 (diff) | |
download | pandoc-c04800305e97a42d2d346fc6b0425817056438b7.tar.gz |
Propagate (DY)LD_LIBRARY_PATH in tests (#6376)
Diffstat (limited to 'test/Tests/Old.hs')
-rw-r--r-- | test/Tests/Old.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/Tests/Old.hs b/test/Tests/Old.hs index 7366a3142..ce0532ac8 100644 --- a/test/Tests/Old.hs +++ b/test/Tests/Old.hs @@ -15,8 +15,11 @@ module Tests.Old (tests) where import Prelude import Data.Algorithm.Diff import Prelude hiding (readFile) +import Data.List (intercalate) +import Data.Maybe (catMaybes) import System.Exit import System.FilePath (joinPath, splitDirectories, (<.>), (</>)) +import qualified System.Environment as Env import Text.Pandoc.Process (pipeProcess) import Test.Tasty (TestTree, testGroup) import Test.Tasty.Golden.Advanced (goldenTest) @@ -298,12 +301,12 @@ testWithNormalize normalizer pandocPath testname opts inp norm = (compareValues norm options) updateGolden where getExpected = normalizer <$> readFile' norm getActual = do + mldpath <- Env.lookupEnv "LD_LIBRARY_PATH" + mdyldpath <- Env.lookupEnv "DYLD_LIBRARY_PATH" let mbDynlibDir = findDynlibDir (reverse $ splitDirectories pandocPath) - let dynlibEnv = case mbDynlibDir of - Nothing -> [] - Just d -> [("DYLD_LIBRARY_PATH", d), - ("LD_LIBRARY_PATH", d)] + let dynlibEnv = [("DYLD_LIBRARY_PATH", intercalate ":" $ catMaybes [mbDynlibDir, mdyldpath]) + ,("LD_LIBRARY_PATH", intercalate ":" $ catMaybes [mbDynlibDir, mldpath])] let env = dynlibEnv ++ [("TMP","."),("LANG","en_US.UTF-8"),("HOME", "./")] (ec, out) <- pipeProcess (Just env) pandocPath options mempty |