Skip to content
Snippets Groups Projects
Commit 2b44677c authored by Matthew Pickering's avatar Matthew Pickering Committed by Mikolaj
Browse files

More consistently pass --package-db flag to tests

Previously `--package-db` was only passed to test which used the `v2-`
prefix.

Now we pass `--package-db` to things which use the `v2-` prefix, not
things which use the `v1-` prefix and by default assume that unprefixed
commands are v2 commands.
parent bfd9bfb5
No related branches found
No related tags found
No related merge requests found
......@@ -4,14 +4,14 @@ Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
- plain-0.1.0.0 *test (first run)
Configuring plain-0.1.0.0...
Preprocessing library for plain-0.1.0.0..
Building library for plain-0.1.0.0..
Preprocessing test suite 'test' for plain-0.1.0.0..
Building test suite 'test' for plain-0.1.0.0..
Preprocessing library for plain-0.1.0.0...
Building library for plain-0.1.0.0...
Preprocessing test suite 'test' for plain-0.1.0.0...
Building test suite 'test' for plain-0.1.0.0...
Running 1 test suites...
Test suite test: RUNNING...
Test suite test: PASS
Test suite logged to: cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/test/plain-0.1.0.0-test.log
Test coverage report written to cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/hpc/vanilla/html/test/hpc_index.html
Test suite logged to: <ROOT>/cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/test/plain-0.1.0.0-test.log
Package coverage report written to <ROOT>/cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/hpc/vanilla/html/hpc_index.html
1 of 1 test suites (1 of 1 test cases) passed.
Package coverage report written to cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/hpc/vanilla/html/plain-0.1.0.0/hpc_index.html
Package coverage report written to <ROOT>/cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/hpc/vanilla/html/hpc_index.html
......@@ -7,8 +7,8 @@ In order, the following will be built:
- one-custom-0.1.0.0 (lib:one-custom) (requires build)
- depend-on-custom-with-exe-0.1.0.0 (lib) (first run)
Configuring one-custom-0.1.0.0...
Preprocessing library for one-custom-0.1.0.0..
Building library for one-custom-0.1.0.0..
Preprocessing library for one-custom-0.1.0.0...
Building library for one-custom-0.1.0.0...
Installing library in <PATH>
Warning: depend-on-custom-with-exe.cabal:16:1: Ignoring trailing fields after sections: "ghc-options"
Configuring library for depend-on-custom-with-exe-0.1.0.0...
......
......@@ -21,7 +21,7 @@ import System.Exit
--
-- Results can be read via 'withPlan', 'buildInfoFile' and 'decodeBuildInfoFile'.
runShowBuildInfo :: [String] -> TestM ()
runShowBuildInfo args = cabal "build" ("--enable-build-info":args)
runShowBuildInfo args = noCabalPackageDb $ cabal "build" ("--enable-build-info":args)
-- | Read 'build-info.json' for a given package and component
-- from disk and record the content. Helpful for defining test-cases
......
......@@ -316,7 +316,7 @@ cabalGArgs global_args cmd args input = do
| cmd `elem` ["v2-sdist", "path"]
= [ "--project-file=" ++ fp | Just fp <- [testCabalProjectFile env] ]
| cmd == "v2-clean"
| cmd == "v2-clean" || cmd == "clean"
= [ "--builddir", testDistDir env ]
++ [ "--project-file=" ++ fp | Just fp <- [testCabalProjectFile env] ]
......@@ -325,10 +325,14 @@ cabalGArgs global_args cmd args input = do
, "-j1" ]
++ [ "--project-file=" ++ fp | Just fp <- [testCabalProjectFile env] ]
++ ["--package-db=" ++ db | Just db <- [testPackageDbPath env]]
| "v1-" `isPrefixOf` cmd
= [ "--builddir", testDistDir env ]
++ install_args
| otherwise
= [ "--builddir", testDistDir env ] ++
install_args
= [ "--builddir", testDistDir env ]
++ ["--package-db=" ++ db | Just db <- [testPackageDbPath env]]
++ install_args
install_args
| cmd == "v1-install" || cmd == "v1-build" = [ "-j1" ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment