forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
By converting this to a setupTest we use the in-tree Cabal library rather than relying on a proxy of the GHC version to provide the right Cabal library version. Supersedes haskell#9398
- Loading branch information
1 parent
15b5b05
commit 3048b96
Showing
2 changed files
with
31 additions
and
14 deletions.
There are no files selected for viewing
32 changes: 22 additions & 10 deletions
32
cabal-testsuite/PackageTests/AutogenModulesToggling/cabal.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,34 @@ | ||
# cabal v2-run | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following will be built: | ||
- test-0.1 (exe:autogen-toggle-test) (first run) | ||
# Setup configure | ||
Configuring test-0.1... | ||
# Setup build | ||
Preprocessing library for test-0.1... | ||
Building library for test-0.1... | ||
Preprocessing executable 'autogen-toggle-test' for test-0.1... | ||
Building executable 'autogen-toggle-test' for test-0.1... | ||
# Setup copy | ||
Installing library in <PATH> | ||
Installing executable autogen-toggle-test in <PATH> | ||
Warning: The directory <ROOT>/cabal.dist/usr/bin is not in the system search path. | ||
# Setup register | ||
Registering library for test-0.1... | ||
# autogen-toggle-test | ||
-----BEGIN CABAL OUTPUT----- | ||
The module says: Real module, ship to production | ||
# cabal v2-run | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following will be built: | ||
- test-0.1 (exe:autogen-toggle-test) (configuration changed) | ||
-----END CABAL OUTPUT----- | ||
# Setup configure | ||
Configuring test-0.1... | ||
# Setup build | ||
Preprocessing library for test-0.1... | ||
Building library for test-0.1... | ||
Preprocessing executable 'autogen-toggle-test' for test-0.1... | ||
Building executable 'autogen-toggle-test' for test-0.1... | ||
# Setup copy | ||
Installing library in <PATH> | ||
Installing executable autogen-toggle-test in <PATH> | ||
Warning: The directory <ROOT>/cabal.dist/usr/bin is not in the system search path. | ||
# Setup register | ||
Registering library for test-0.1... | ||
# autogen-toggle-test | ||
-----BEGIN CABAL OUTPUT----- | ||
The module says: Prebuilt module, don't use in production | ||
-----END CABAL OUTPUT----- |
13 changes: 9 additions & 4 deletions
13
cabal-testsuite/PackageTests/AutogenModulesToggling/cabal.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
import Test.Cabal.Prelude | ||
|
||
main :: IO () | ||
main = cabalTest . recordMode RecordMarked $ do | ||
skipUnlessGhcVersion ">= 9.7" | ||
cabal "v2-run" ["-fgenerate", "autogen-toggle-test"] | ||
cabal "v2-run" ["-f-generate", "autogen-toggle-test"] | ||
main = setupTest . withPackageDb $ do | ||
-- This test exposes a recompilation bug in ghc versions 9.0.2 and 9.2.8 | ||
skipIfGhcVersion "== 9.0.2 || == 9.2.8" | ||
setup_install ["-fgenerate"] | ||
r1 <- runInstalledExe' "autogen-toggle-test" [] | ||
setup_install ["-f-generate"] | ||
r2 <- runInstalledExe' "autogen-toggle-test" [] | ||
assertOutputContains "Real module, ship to production" r1 | ||
assertOutputContains "Prebuilt module, don't use in production" r2 |