diff --git a/cabal-testsuite/PackageTests/AutogenModulesToggling/cabal.out b/cabal-testsuite/PackageTests/AutogenModulesToggling/cabal.out index 3b848ef431a..888a1a836b1 100644 --- a/cabal-testsuite/PackageTests/AutogenModulesToggling/cabal.out +++ b/cabal-testsuite/PackageTests/AutogenModulesToggling/cabal.out @@ -1,22 +1,34 @@ -# cabal v2-run -Resolving dependencies... -Build profile: -w ghc- -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 +Installing executable autogen-toggle-test in +Warning: The directory /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- -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 +Installing executable autogen-toggle-test in +Warning: The directory /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----- diff --git a/cabal-testsuite/PackageTests/AutogenModulesToggling/cabal.test.hs b/cabal-testsuite/PackageTests/AutogenModulesToggling/cabal.test.hs index 4b0e1639c12..e326132020f 100644 --- a/cabal-testsuite/PackageTests/AutogenModulesToggling/cabal.test.hs +++ b/cabal-testsuite/PackageTests/AutogenModulesToggling/cabal.test.hs @@ -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