-
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.
Increase purview of --dry-run and --only-download flags (#7379)
Changes the behavior of the following commands under the `--dry-run` and `--only-download` flags - `v2-configure` and `v2-freeze` do not write their respective files - `v2-exec` and `v2-run` do not run the target executable Adds package tests for the configure and freeze commands.
- Loading branch information
1 parent
aabe562
commit 84884bb
Showing
13 changed files
with
115 additions
and
35 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 |
5 changes: 5 additions & 0 deletions
5
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,5 @@ | ||
# cabal v2-configure | ||
Config file not written due to flag(s). | ||
# cabal v2-configure | ||
Config file not written due to flag(s). | ||
# cabal v2-configure |
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: . |
18 changes: 18 additions & 0 deletions
18
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,18 @@ | ||
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 or --only-download | ||
cabalG ["--store-dir=" ++ storeDir] "v2-configure" ["--dry-run"] | ||
cabalG ["--store-dir=" ++ storeDir] "v2-configure" ["--only-download"] | ||
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
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 @@ | ||
synopsis: --dry-run and --only-download effect v2-configure, v2-freeze, v2-run, and v2-exec | ||
pr: #7407 | ||
issues: #7379 | ||
decription: { v2-configure, v2-freeze, v2-run, and v2-exec now behave expectedly under the --dry-run and --only-download flags } |