Add logging and assertions on output to cyclical test
[cabal.git] / cabal-testsuite / PackageTests / WarnEarlyOverwrite / dirty-install.test.hs
blob6578a891c0ddbbcb1aaba3abb46022ca6bb16d9b
1 import Test.Cabal.Prelude
3 import System.FilePath
5 main = withShorterPathForNewBuildStore $ \storeDir -> cabalTest $ do
6 -- Windows does not natively include a touch command.
7 -- SEE: https://stackoverflow.com/questions/30011267/create-an-empty-file-on-the-commandline-in-windows-like-the-linux-touch-command
8 skipIfWindows
9 let options = ["--store-dir=" ++ storeDir, "--installdir=" ++ storeDir]
10 -- Touch the target to see if the warning is made early before the build.
11 _ <- runM "touch" [storeDir </> "warn-early-overwrite"] Nothing
12 fails $ cabalG options "v2-install" []
13 cabalG options "v2-install" ["--overwrite-policy=always"]