Commit d33ad535 authored by kristenk's avatar kristenk
Browse files

Add Cabal package test for Buildable field.

parent 53d85bb0
......@@ -77,6 +77,8 @@ extra-source-files:
tests/PackageTests/BuildDeps/TargetSpecificDeps3/lemon.hs
tests/PackageTests/BuildDeps/TargetSpecificDeps3/my.cabal
tests/PackageTests/BuildTestSuiteDetailedV09/Dummy2.hs
tests/PackageTests/BuildableField/BuildableField.cabal
tests/PackageTests/BuildableField/Main.hs
tests/PackageTests/CMain/Bar.hs
tests/PackageTests/CMain/foo.c
tests/PackageTests/CMain/my.cabal
......
name: BuildableField
version: 0.1.0.0
cabal-version: >=1.2
build-type: Simple
license: BSD3
flag build-exe
default: True
library
executable my-executable
build-depends: base, unavailable-package
main-is: Main.hs
if !flag(build-exe)
buildable: False
import UnavailableModule
main :: IO ()
main = putStrLn "Hello"
......@@ -223,6 +223,14 @@ tests config =
cabal_build ["--enable-tests"]
cabal "test" []
-- Test that Cabal can choose flags to disable building a component when that
-- component's dependencies are unavailable. The build should succeed without
-- requiring the component's dependencies or imports.
, tc "BuildableField" $ do
r <- cabal' "configure" ["-v"]
assertOutputContains "Flags chosen: build-exe=False" r
cabal "build" []
]
where
-- Shared test function for BuildDeps/InternalLibrary* tests.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment