Skip to content

Commit 2787ba3

Browse files
committed
Split ReplProjectTarget test
1 parent ab4d293 commit 2787ba3

File tree

17 files changed

+66
-17
lines changed

17 files changed

+66
-17
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# checking repl command with a 'cabal.project' and --ignore-project
2+
# cabal repl
3+
Resolving dependencies...
4+
Build profile: -w ghc-<GHCVER> -O1
5+
In order, the following will be built:
6+
- fake-package-0 (lib) (first run)
7+
Configuring library for fake-package-0...
8+
# checking repl command with a 'cabal.project' and no project options
9+
# cabal repl
10+
Resolving dependencies...
11+
Build profile: -w ghc-<GHCVER> -O1
12+
In order, the following will be built:
13+
- pkg-one-0.1 (interactive) (first run)
14+
Configuring pkg-one-0.1...
15+
Preprocessing library for pkg-one-0.1...
16+
Build profile: -w ghc-<GHCVER> -O1
17+
In order, the following will be built:
18+
- pkg-one-0.1 (configuration changed)
19+
Configuring pkg-one-0.1...
20+
# checking repl command with a single package in 'cabal.project'
21+
# cabal repl
22+
Build profile: -w ghc-<GHCVER> -O1
23+
In order, the following will be built:
24+
- pkg-one-0.1 (interactive) (configuration changed)
25+
Configuring pkg-one-0.1...
26+
Preprocessing library for pkg-one-0.1...
27+
Build profile: -w ghc-<GHCVER> -O1
28+
In order, the following will be built:
29+
- pkg-one-0.1 (configuration changed)
30+
Configuring pkg-one-0.1...
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import Test.Cabal.Prelude
2+
import Data.List (isInfixOf)
3+
4+
main = cabalTest . recordMode RecordMarked $ do
5+
liftIO $ skipIfWindows "I'm seeing extra newlines in the output on Windows"
6+
let log = recordHeader . pure
7+
8+
log "checking repl command with a 'cabal.project' and --ignore-project"
9+
ignored <- cabal' "repl" ["--ignore-project"]
10+
assertOutputContains "fake-package-0 (lib) (first run)" ignored
11+
12+
log "checking repl command with a 'cabal.project' and no project options"
13+
defaultProject <- cabal' "repl" []
14+
assertOutputContains "the following will be built" defaultProject
15+
assertOutputContains "pkg-one-0.1" defaultProject
16+
17+
log "checking repl command with a single package in 'cabal.project'"
18+
defaultProject <- cabal' "repl" [ "--project-file=cabal.project" ]
19+
assertOutputContains "the following will be built" defaultProject
20+
assertOutputContains "pkg-one-0.1" defaultProject
21+
22+
return ()

cabal-testsuite/PackageTests/ReplProjectTarget/cabal.out renamed to cabal-testsuite/PackageTests/ReplProjectTargetTwoPkgs/cabal.out

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,3 @@ There are no packages in 'empty.project'. Please add a package to the project an
3232
# cabal repl
3333
# checking repl command with a missing 'missing.project'
3434
# cabal repl
35-
# checking repl command with a single package in 'one.project'
36-
# cabal repl
37-
Resolving dependencies...
38-
Build profile: -w ghc-<GHCVER> -O1
39-
In order, the following will be built:
40-
- pkg-one-0.1 (interactive) (first run)
41-
Configuring pkg-one-0.1...
42-
Preprocessing library for pkg-one-0.1...
43-
Build profile: -w ghc-<GHCVER> -O1
44-
In order, the following will be built:
45-
- pkg-one-0.1 (configuration changed)
46-
Configuring pkg-one-0.1...

cabal-testsuite/PackageTests/ReplProjectTarget/cabal.test.hs renamed to cabal-testsuite/PackageTests/ReplProjectTargetTwoPkgs/cabal.test.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,4 @@ main = cabalTest . recordMode RecordMarked $ do
3838
dotMissing <- fails $ cabal' "repl" [ "--project-dir=.", "--project-file=missing.project" ]
3939
assertOutputContains "The given project directory/file combination './missing.project' does not exist." dotMissing
4040

41-
log "checking repl command with a single package in 'one.project'"
42-
oneProject <- cabal' "repl" [ "--project-file=one.project" ]
43-
assertOutputContains "the following will be built" oneProject
44-
assertOutputContains "pkg-one-0.1 (interactive) (first run)" oneProject
45-
4641
return ()

0 commit comments

Comments
 (0)