testsuite: Refactor withShorterPathForNewBuildStore
commit2a2d0b3049ee412fe63f18bd5d94ebe6b2114804
authorMatthew Pickering <matthewtpickering@gmail.com>
Thu, 16 Nov 2023 12:21:15 +0000 (16 12:21 +0000)
committerRodrigo Mesquita <rodrigo.m.mesquita@gmail.com>
Fri, 19 Apr 2024 10:03:16 +0000 (19 11:03 +0100)
tree9013d90a33b7518b00c73ab3620b9ec760b93c6f
parenteb0f95b801b36757098c36d02b6dd394a15bac61
testsuite: Refactor withShorterPathForNewBuildStore

This makes `withShorterPathForNewBuildStore` fit more nicely into the
rest of the testing infrastructure.

* Move `withShorterPathForNewBuildStore` to `TestM` monad
* Move responsibility for passing `--store-dir` to `cabalGArgs` function
* Move `findDependencyInStore` into `TestM`, and remove requirement to
  pass path to store directory.
* Introduce `testStoreDir` function which returns the store location
  (and honours `withShorterPathForNewBuildStore`)
* Migrate tests which use `withShorterPathForNewBuildStore`.
23 files changed:
Cabal-tests/Cabal-tests.cabal
Cabal-tests/lib/Test/Utils/TempTestDir.hs
Cabal-tests/tests/UnitTests/Distribution/PackageDescription/Check.hs
cabal-testsuite/PackageTests/Backpack/Includes3/cabal-repo.test.hs
cabal-testsuite/PackageTests/Backpack/T6385/cabal.test.hs
cabal-testsuite/PackageTests/BuildTargets/UseLocalPackageForSetup/use-local-package-as-setup-dep.test.hs
cabal-testsuite/PackageTests/CopyHie/cabal.test.hs
cabal-testsuite/PackageTests/HaddockArgs/hoogle.test.hs
cabal-testsuite/PackageTests/HaddockArgs/quickjump.test.hs
cabal-testsuite/PackageTests/HaddockBuildDepends/cabal.test.hs
cabal-testsuite/PackageTests/NewBuild/CustomSetup/LocalPackageWithCustomSetup/build-local-package-with-custom-setup.test.hs
cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs
cabal-testsuite/PackageTests/NewBuild/T4375/cabal.test.hs
cabal-testsuite/PackageTests/NewConfigure/ConfigFile/cabal.test.hs
cabal-testsuite/PackageTests/NewFreeze/FreezeFile/new_freeze.test.hs
cabal-testsuite/PackageTests/OfflineFlag/offlineFlag.test.hs
cabal-testsuite/PackageTests/Regression/T5409/use-different-versions-of-dependency-for-library-and-build-tool.test.hs
cabal-testsuite/PackageTests/Regression/T5782Diamond/cabal.test.hs
cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-copy.test.hs
cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-symlink.test.hs
cabal-testsuite/PackageTests/WarnEarlyOverwrite/dirty-install.test.hs
cabal-testsuite/src/Test/Cabal/Monad.hs
cabal-testsuite/src/Test/Cabal/Prelude.hs