diff --git a/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/cabal.test.hs b/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/cabal.test.hs index 39433896ce3..e2d819e44d6 100644 --- a/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/cabal.test.hs +++ b/cabal-testsuite/PackageTests/HaddockKeepTmpsCustom/cabal.test.hs @@ -11,11 +11,11 @@ main = cabalTest $ recordMode DoNotRecord $ withProjectFile "cabal.project" $ do -- "foobar.ext" will be "fooXXX.ext". let glob = if isWindows - then "**/had*.txt" - else "**/haddock-response*.txt" + then "had*.txt" + else "haddock-response*.txt" -- Check that there is a response file. - responseFiles <- assertGlobMatchesTestDir testDistDir glob + responseFiles <- assertGlobMatchesTestDir testTmpDir glob -- Check that the matched response file is not empty, and is indeed a Haddock -- response file. diff --git a/cabal-testsuite/src/Test/Cabal/Monad.hs b/cabal-testsuite/src/Test/Cabal/Monad.hs index 63605768de7..69c958240c1 100644 --- a/cabal-testsuite/src/Test/Cabal/Monad.hs +++ b/cabal-testsuite/src/Test/Cabal/Monad.hs @@ -410,6 +410,10 @@ runTestM mode m = -- effect on Windows. , ("CABAL_DIR", Just (testCabalDir env)) , ("CABAL_CONFIG", Just (testUserCabalConfigFile env)) + -- Set `TMPDIR` so that temporary files aren't created in the global `TMPDIR`. + , ("TMPDIR", Just tmp_dir) + -- Windows uses `TEMP` for the `TMPDIR`. + , ("TEMP", Just tmp_dir) ], testShouldFail = False, testRelativeCurrentDir = ".",