Skip to content
Snippets Groups Projects
Commit 999d0f27 authored by Francesco Gazzetta's avatar Francesco Gazzetta
Browse files

Add test for #4608: new-run on exe+library

parent 2b8cb2c2
No related branches found
No related tags found
No related merge requests found
name: ExeAndLib
version: 1.0
build-type: Simple
cabal-version: >= 1.10
executable foo
main-is: Main.hs
build-depends: base
default-language: Haskell2010
library
exposed-modules: Main
default-language: Haskell2010
main = putStrLn "Hello World"
# cabal new-run
Resolving dependencies...
In order, the following will be built:
- ExeAndLib-1.0 (exe:foo) (first run)
Configuring executable 'foo' for ExeAndLib-1.0..
Preprocessing executable 'foo' for ExeAndLib-1.0..
Building executable 'foo' for ExeAndLib-1.0..
# cabal new-run
cabal: The run command is for running executables, but the target 'ExeAndLib' refers to the library in the package ExeAndLib-1.0 from the package ExeAndLib-1.0.
packages: .
import Test.Cabal.Prelude
import Control.Monad ( (>=>) )
main = cabalTest $ do
-- the exe
cabal' "new-run" ["foo"] >>= assertOutputContains "Hello World"
-- the lib
fails (cabal' "new-run" ["ExeAndLib"]) >>= assertOutputDoesNotContain "Hello World"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment