diff --git a/src/Run.hs b/src/Run.hs index dc103c47..9ad3c086 100644 --- a/src/Run.hs +++ b/src/Run.hs @@ -36,12 +36,13 @@ doctest args | "--help" `elem` args = putStr usage | "--version" `elem` args = printVersion | otherwise = do - -- Look up the PACKAGE_SANDBOX environment variable and, if present, add - -- it to the list of package databases GHC searches. Intended to make - -- testing from inside sandboxes such as cabal-dev simpler. + -- Look up the HASKELL_PACKAGE_SANDBOX environment variable and, if + -- present, add it to the list of package databases GHC searches. + -- Intended to make testing from inside sandboxes such as cabal-dev + -- simpler. env <- getEnvironment let addPackageConf = - case lookup "PACKAGE_SANDBOX" env of + case lookup "HASKELL_PACKAGE_SANDBOX" env of Nothing -> id Just p -> \rest -> "-package-conf" : p : rest diff --git a/test/RunSpec.hs b/test/RunSpec.hs index 291f9e79..e614f1ff 100644 --- a/test/RunSpec.hs +++ b/test/RunSpec.hs @@ -71,7 +71,7 @@ spec = do , "Try `doctest --help' for more information." ] - it "respects PACKAGE_SANDBOX" $ do + it "respects HASKELL_PACKAGE_SANDBOX" $ do withCurrentDirectory "test/integration/custom-package-conf/foo" $ do ExitSuccess <- rawSystem "ghc-pkg" ["init", "../packages"] ExitSuccess <- rawSystem "cabal" ["configure", "--disable-optimization", "--disable-library-profiling", "--package-db=../packages"] @@ -79,7 +79,7 @@ spec = do ExitSuccess <- rawSystem "cabal" ["register", "--inplace"] return () - withEnv "PACKAGE_SANDBOX" "test/integration/custom-package-conf/packages" $ do + withEnv "HASKELL_PACKAGE_SANDBOX" "test/integration/custom-package-conf/packages" $ do hCapture_ [stderr] (doctest ["test/integration/custom-package-conf/Bar.hs"]) `shouldReturn` "Examples: 2 Tried: 2 Errors: 0 Failures: 0\n"