-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reinstall test to LinkerOptions/NonignoredConfigs
- Loading branch information
1 parent
6c69db7
commit 851e598
Showing
3 changed files
with
100 additions
and
0 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
54 changes: 54 additions & 0 deletions
54
cabal-testsuite/PackageTests/LinkerOptions/NonignoredConfigs/reinstall.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,54 @@ | ||
# cabal v2-install | ||
Wrote tarball sdist to <ROOT>/reinstall.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following will be built: | ||
- basic-0.1 (lib) (requires build) | ||
Configuring library for basic-0.1... | ||
Preprocessing library for basic-0.1... | ||
Building library for basic-0.1... | ||
Installing library in <PATH> | ||
# cabal v2-install | ||
Wrote tarball sdist to <ROOT>/reinstall.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following will be built: | ||
- basic-0.1 (lib) (requires build) | ||
Configuring library for basic-0.1... | ||
Preprocessing library for basic-0.1... | ||
Building library for basic-0.1... | ||
Installing library in <PATH> | ||
# cabal v2-install | ||
Wrote tarball sdist to <ROOT>/reinstall.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz | ||
Resolving dependencies... | ||
# cabal v2-install | ||
Wrote tarball sdist to <ROOT>/reinstall.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz | ||
Resolving dependencies... | ||
# cabal v2-install | ||
Wrote tarball sdist to <ROOT>/reinstall.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz | ||
Error: [Cabal-7145] | ||
Packages requested to install already exist in environment file at <ROOT>/reinstall.dist/basic0.env. Overwriting them may break other packages. Use --force-reinstalls to proceed anyway. Packages: basic | ||
# cabal v2-install | ||
Wrote tarball sdist to <ROOT>/reinstall.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz | ||
Error: [Cabal-7145] | ||
Packages requested to install already exist in environment file at <ROOT>/reinstall.dist/basic1.env. Overwriting them may break other packages. Use --force-reinstalls to proceed anyway. Packages: basic | ||
# cabal v2-install | ||
Wrote tarball sdist to <ROOT>/reinstall.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz | ||
Error: [Cabal-7145] | ||
Packages requested to install already exist in environment file at <ROOT>/reinstall.dist/basic2.env. Overwriting them may break other packages. Use --force-reinstalls to proceed anyway. Packages: basic | ||
# cabal v2-install | ||
Wrote tarball sdist to <ROOT>/reinstall.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz | ||
Error: [Cabal-7145] | ||
Packages requested to install already exist in environment file at <ROOT>/reinstall.dist/basic3.env. Overwriting them may break other packages. Use --force-reinstalls to proceed anyway. Packages: basic | ||
# cabal v2-install | ||
Wrote tarball sdist to <ROOT>/reinstall.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz | ||
Resolving dependencies... | ||
# cabal v2-install | ||
Wrote tarball sdist to <ROOT>/reinstall.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz | ||
Resolving dependencies... | ||
# cabal v2-install | ||
Wrote tarball sdist to <ROOT>/reinstall.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz | ||
Resolving dependencies... | ||
# cabal v2-install | ||
Wrote tarball sdist to <ROOT>/reinstall.dist/work/./basic/../dist/sdist/basic-0.1.tar.gz | ||
Resolving dependencies... |
45 changes: 45 additions & 0 deletions
45
cabal-testsuite/PackageTests/LinkerOptions/NonignoredConfigs/reinstall.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,45 @@ | ||
import Test.Cabal.Prelude | ||
|
||
import Control.Monad (forM, foldM_) | ||
import Data.List (isPrefixOf, tails) | ||
|
||
data Linking = Static | Dynamic deriving (Eq, Ord, Show) | ||
|
||
links :: [Linking] | ||
links = [Static, Dynamic] | ||
|
||
linkConfigFlags :: Linking -> [String] | ||
linkConfigFlags Static = | ||
[ | ||
] | ||
linkConfigFlags Dynamic = | ||
[ | ||
"--enable-shared", | ||
"--enable-executable-dynamic", | ||
"--disable-library-vanilla" | ||
] | ||
|
||
lrun :: [Linking] | ||
lrun = [Static, Dynamic, Static, Dynamic] | ||
|
||
main = cabalTest $ do | ||
skipIfWindows | ||
withPackageDb $ do | ||
forM_ (zip [0..] lrun) $ \(idx, linking) -> do | ||
withDirectory "basic" $ do | ||
withSourceCopyDir ("basic" ++ show idx) $ do | ||
withDirectory ".." $ do | ||
packageEnv <- (</> ("basic" ++ show idx ++ ".env")) . testWorkDir <$> getTestEnv | ||
cabal "v2-install" $ ["--disable-deterministic", "--lib", "--package-env=" ++ packageEnv] ++ linkConfigFlags linking ++ ["basic"] | ||
forM_ (zip [0..] lrun) $ \(idx, linking) -> do | ||
withDirectory "basic" $ do | ||
withSourceCopyDir ("basic" ++ show idx) $ do | ||
withDirectory ".." $ do | ||
packageEnv <- (</> ("basic" ++ show idx ++ ".env")) . testWorkDir <$> getTestEnv | ||
fails $ cabal "v2-install" $ ["--disable-deterministic", "--lib", "--package-env=" ++ packageEnv] ++ linkConfigFlags linking ++ ["basic"] | ||
forM_ (zip [0..] lrun) $ \(idx, linking) -> do | ||
withDirectory "basic" $ do | ||
withSourceCopyDir ("basic" ++ show idx) $ do | ||
withDirectory ".." $ do | ||
packageEnv <- (</> ("basic" ++ show idx ++ ".env")) . testWorkDir <$> getTestEnv | ||
cabal "v2-install" $ ["--force-reinstalls", "--disable-deterministic", "--lib", "--package-env=" ++ packageEnv] ++ linkConfigFlags linking ++ ["basic"] |