-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
repl --keep-temp-files
test with custom Setup.hs
- Loading branch information
Showing
11 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.no.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# cabal clean | ||
# cabal v2-repl | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -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... |
10 changes: 10 additions & 0 deletions
10
cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# cabal v2-repl | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -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... |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.project
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
packages: pkg-a/*.cabal | ||
packages: pkg-b/*.cabal |
33 changes: 33 additions & 0 deletions
33
cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/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 |
---|---|---|
@@ -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*/" |
11 changes: 11 additions & 0 deletions
11
cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.yes.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# cabal clean | ||
# cabal v2-repl | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -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... |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/Foo.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module Foo where | ||
|
||
foo :: Int | ||
foo = 42 |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/Setup.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Distribution.Simple | ||
|
||
main :: IO () | ||
main = defaultMain |
12 changes: 12 additions & 0 deletions
12
cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-a/pkg-a.cabal
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 |
---|---|---|
@@ -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 |
6 changes: 6 additions & 0 deletions
6
cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/Bar.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module Bar (foo, bar) where | ||
|
||
import Foo (foo) | ||
|
||
bar :: String | ||
bar = "foo is " <> show foo |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/Setup.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Distribution.Simple | ||
|
||
main :: IO () | ||
main = defaultMain |
12 changes: 12 additions & 0 deletions
12
cabal-testsuite/PackageTests/MultiRepl/CustomSetupKeepTempFiles/pkg-b/pkg-b.cabal
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 |
---|---|---|
@@ -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 |