diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.no.out b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.no.out new file mode 100644 index 00000000000..073e87feea2 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.no.out @@ -0,0 +1,11 @@ +# cabal clean +# cabal v2-repl +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - pkg-a-1 (interactive) (first run) + - pkg-b-0 (interactive) (first run) +Configuring pkg-a-1... +Preprocessing library for pkg-a-1... +Configuring pkg-b-0... +Preprocessing library for pkg-b-0... diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.out b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.out new file mode 100644 index 00000000000..9c141d7ac42 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.out @@ -0,0 +1,10 @@ +# cabal v2-repl +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - pkg-a-1 (interactive) (lib) (first run) + - pkg-b-0 (interactive) (lib) (first run) +Configuring library for pkg-a-1... +Preprocessing library for pkg-a-1... +Configuring library for pkg-b-0... +Preprocessing library for pkg-b-0... diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.project b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.project new file mode 100644 index 00000000000..bf8292adeb5 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.project @@ -0,0 +1,2 @@ +packages: pkg-a/*.cabal +packages: pkg-b/*.cabal diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.test.hs b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.test.hs new file mode 100644 index 00000000000..ea0851f1f2c --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.test.hs @@ -0,0 +1,33 @@ +import Test.Cabal.Prelude + +main = do + cabalTest' "yes" $ do + skipUnlessAnyCabalVersion ">= 3.11" + skipUnlessGhcVersion ">= 9.4" + cabal' "clean" [] + res <- + cabalWithStdin + "v2-repl" + [ "--keep-temp-files" + , "--enable-multi-repl" + , "pkg-b" + , "pkg-a" + ] + "Bar.bar" + assertOutputContains "foo is 42" res + void $ assertGlobMatchesTestDir testDistDir "multi-out*/" + + cabalTest' "no" $ do + skipUnlessAnyCabalVersion ">= 3.11" + skipUnlessGhcVersion ">= 9.4" + cabal' "clean" [] + res <- + cabalWithStdin + "v2-repl" + [ "--enable-multi-repl" + , "pkg-b" + , "pkg-a" + ] + "Bar.bar" + assertOutputContains "foo is 42" res + void $ assertGlobDoesNotMatchTestDir testDistDir "multi-out*/" diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.yes.out b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.yes.out new file mode 100644 index 00000000000..073e87feea2 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.yes.out @@ -0,0 +1,11 @@ +# cabal clean +# cabal v2-repl +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - pkg-a-1 (interactive) (first run) + - pkg-b-0 (interactive) (first run) +Configuring pkg-a-1... +Preprocessing library for pkg-a-1... +Configuring pkg-b-0... +Preprocessing library for pkg-b-0... diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/Foo.hs b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/Foo.hs new file mode 100644 index 00000000000..208f04764de --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/Foo.hs @@ -0,0 +1,4 @@ +module Foo where + +foo :: Int +foo = 42 diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/Setup.hs b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/Setup.hs new file mode 100644 index 00000000000..00bfe1fe441 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/Setup.hs @@ -0,0 +1,4 @@ +import Distribution.Simple + +main :: IO () +main = defaultMain diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/pkg-a.cabal b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/pkg-a.cabal new file mode 100644 index 00000000000..3c3bbde21a2 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/pkg-a.cabal @@ -0,0 +1,12 @@ +cabal-version: 2.2 +name: pkg-a +version: 1 +build-type: Custom + +custom-setup + setup-depends: Cabal, base + +library + default-language: Haskell2010 + build-depends: base + exposed-modules: Foo diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/Bar.hs b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/Bar.hs new file mode 100644 index 00000000000..114eedd9306 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/Bar.hs @@ -0,0 +1,6 @@ +module Bar (foo, bar) where + +import Foo (foo) + +bar :: String +bar = "foo is " <> show foo diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/Setup.hs b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/Setup.hs new file mode 100644 index 00000000000..00bfe1fe441 --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/Setup.hs @@ -0,0 +1,4 @@ +import Distribution.Simple + +main :: IO () +main = defaultMain diff --git a/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/pkg-b.cabal b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/pkg-b.cabal new file mode 100644 index 00000000000..a354090771d --- /dev/null +++ b/cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/pkg-b.cabal @@ -0,0 +1,12 @@ +cabal-version: 2.2 +name: pkg-b +version: 0 +build-type: Custom + +custom-setup + setup-depends: Cabal, base + +library + default-language: Haskell2010 + build-depends: base, pkg-a + exposed-modules: Bar