Skip to content

Commit 3048b96

Browse files
committed
Fix AutogenModulesToggling test
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
1 parent 15b5b05 commit 3048b96

File tree

2 files changed

+31
-14
lines changed

2 files changed

+31
-14
lines changed
Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
1-
# cabal v2-run
2-
Resolving dependencies...
3-
Build profile: -w ghc-<GHCVER> -O1
4-
In order, the following will be built:
5-
- test-0.1 (exe:autogen-toggle-test) (first run)
1+
# Setup configure
62
Configuring test-0.1...
3+
# Setup build
74
Preprocessing library for test-0.1...
85
Building library for test-0.1...
96
Preprocessing executable 'autogen-toggle-test' for test-0.1...
107
Building executable 'autogen-toggle-test' for test-0.1...
8+
# Setup copy
9+
Installing library in <PATH>
10+
Installing executable autogen-toggle-test in <PATH>
11+
Warning: The directory <ROOT>/cabal.dist/usr/bin is not in the system search path.
12+
# Setup register
13+
Registering library for test-0.1...
14+
# autogen-toggle-test
15+
-----BEGIN CABAL OUTPUT-----
1116
The module says: Real module, ship to production
12-
# cabal v2-run
13-
Resolving dependencies...
14-
Build profile: -w ghc-<GHCVER> -O1
15-
In order, the following will be built:
16-
- test-0.1 (exe:autogen-toggle-test) (configuration changed)
17+
-----END CABAL OUTPUT-----
18+
# Setup configure
1719
Configuring test-0.1...
20+
# Setup build
1821
Preprocessing library for test-0.1...
1922
Building library for test-0.1...
2023
Preprocessing executable 'autogen-toggle-test' for test-0.1...
2124
Building executable 'autogen-toggle-test' for test-0.1...
25+
# Setup copy
26+
Installing library in <PATH>
27+
Installing executable autogen-toggle-test in <PATH>
28+
Warning: The directory <ROOT>/cabal.dist/usr/bin is not in the system search path.
29+
# Setup register
30+
Registering library for test-0.1...
31+
# autogen-toggle-test
32+
-----BEGIN CABAL OUTPUT-----
2233
The module says: Prebuilt module, don't use in production
34+
-----END CABAL OUTPUT-----
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import Test.Cabal.Prelude
22

33
main :: IO ()
4-
main = cabalTest . recordMode RecordMarked $ do
5-
skipUnlessGhcVersion ">= 9.7"
6-
cabal "v2-run" ["-fgenerate", "autogen-toggle-test"]
7-
cabal "v2-run" ["-f-generate", "autogen-toggle-test"]
4+
main = setupTest . withPackageDb $ do
5+
-- This test exposes a recompilation bug in ghc versions 9.0.2 and 9.2.8
6+
skipIfGhcVersion "== 9.0.2 || == 9.2.8"
7+
setup_install ["-fgenerate"]
8+
r1 <- runInstalledExe' "autogen-toggle-test" []
9+
setup_install ["-f-generate"]
10+
r2 <- runInstalledExe' "autogen-toggle-test" []
11+
assertOutputContains "Real module, ship to production" r1
12+
assertOutputContains "Prebuilt module, don't use in production" r2

0 commit comments

Comments
 (0)