Skip to content
7 changes: 4 additions & 3 deletions hls-test-utils/src/Test/Hls.hs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ import System.Directory (canonicalizePath,
import System.Environment (lookupEnv, setEnv)
import System.FilePath
import System.IO.Extra (newTempDirWithin)
import System.IO.Temp (createTempDirectory)
import System.IO.Unsafe (unsafePerformIO)
import System.Process.Extra (createPipe)
import System.Time.Extra
Expand Down Expand Up @@ -556,9 +557,9 @@ setupTestEnvironment :: IO FilePath
setupTestEnvironment = do
tmpDirRoot <- getTemporaryDirectory
let testRoot = tmpDirRoot </> "hls-test-root"
testCacheDir = testRoot </> ".cache"
createDirectoryIfMissing True testCacheDir
setEnv "XDG_CACHE_HOME" testCacheDir
createDirectoryIfMissing True testRoot
tempCacheDir <- createTempDirectory testRoot ".cache"
setEnv "XDG_CACHE_HOME" tempCacheDir
pure testRoot

goldenWithHaskellDocFormatter
Expand Down