forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
increase commands that --dry-run works with (haskell#7379)
Changes the behavior of the following commands under the --dry-run flag - `v2-configure` and `v2-freeze` print out what the file contents would've been rather than writing the file. - `v2-exec` and `v2-run` print out the command that would've been executed rather than doing so. Adds package tests for the configure and freeze commands.
- Loading branch information
1 parent
ac5cb4c
commit ced6590
Showing
12 changed files
with
127 additions
and
28 deletions.
There are no files selected for viewing
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
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
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
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
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
7 changes: 7 additions & 0 deletions
7
cabal-testsuite/PackageTests/NewConfigure/ConfigFile/ConfigFile.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,7 @@ | ||
name: ConfigFile | ||
version: 0.1.0.0 | ||
author: Foo Bar | ||
maintainer: cabal-dev@haskell.org | ||
build-type: Simple | ||
cabal-version: >=1.10 | ||
|
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/NewConfigure/ConfigFile/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,2 @@ | ||
import Distribution.Simple | ||
main = defaultMain |
17 changes: 17 additions & 0 deletions
17
cabal-testsuite/PackageTests/NewConfigure/ConfigFile/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,17 @@ | ||
# cabal v2-configure | ||
Would write the following configuration file: | ||
store-dir: <GBLTMPDIR> | ||
verbose: verbose +nowrap +markoutput | ||
builddir: <ROOT>/cabal.dist/work/./dist | ||
jobs: 1 | ||
project-file: cabal.project | ||
ignore-project: False | ||
|
||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following would be built: | ||
- ConfigFile-0.1.0.0 (first run) | ||
# cabal v2-configure | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following would be built: | ||
- ConfigFile-0.1.0.0 (first run) |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/NewConfigure/ConfigFile/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 @@ | ||
packages: . |
17 changes: 17 additions & 0 deletions
17
cabal-testsuite/PackageTests/NewConfigure/ConfigFile/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,17 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- Test that 'cabal v2-configure' generates the config file appropriately | ||
main = withShorterPathForNewBuildStore $ \storeDir -> | ||
cabalTest . withSourceCopy $ do | ||
cwd <- fmap testCurrentDir getTestEnv | ||
let configFile = cwd </> "cabal.project.local" | ||
|
||
shouldNotExist configFile | ||
|
||
-- should not create config file with --dry-run | ||
cabalG ["--store-dir=" ++ storeDir] "v2-configure" ["--dry-run"] | ||
shouldNotExist configFile | ||
|
||
-- should create the config file | ||
cabalG ["--store-dir=" ++ storeDir] "v2-configure" [] | ||
shouldExist configFile |
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
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