I’m not able to run a test-suite inside a subpackage in a multi-package project that is hidden behind a Cabal flag. I would like for that test-suite to be disabled by default, e.g. when running cabal test all
, but enabled when explicitly called for. However,
$ cabal test -fintegration-tests all
and its variations like cabal test --flags="+integration-tests" all
(see 2. Project Description — cabal.project File — Cabal 3.14.1.1 User's Guide) don’t seem to forward the flag to the subpackage(s). What am i doing wrong, or is it even the right approach?
Here some context:
-- subpackage.cabal
flag integration-tests
description: Enable integration tests
default: False
if flag(integration-tests)
test-suite test-integration
type: exitcode-stdio-1.0
hs-source-dirs: tests
main-is: TestIntegration.hs
build-depends: base
...
...
├── cabal.project
└── subpackage
├── src
│ ...
├── tests
│ └── TestIntegration.hs
└── subpackage.cabal