pkgs/build-support/cabal: add support for running specific tests only via 'testTarget'

The dns packages requires this feature, because it ships two test programs: one
of them requires network access (so we cannot run it), but the other test does
not. Setting testTarget appropriately allows us to run only one of the two
suites.
This commit is contained in:
Peter Simons 2013-08-26 12:39:33 +02:00
parent 9ac8ea937c
commit fb83f8605f

View File

@ -80,6 +80,9 @@ assert enableCheckPhase -> stdenv.lib.versionOlder "7" ghc.ghcVersion;
# build-depends Cabal fields stated in test-suite stanzas
testDepends = [];
# target(s) passed to the cabal test phase as an argument
testTarget = "";
# build-tools Cabal field
buildTools = [];
@ -159,7 +162,7 @@ assert enableCheckPhase -> stdenv.lib.versionOlder "7" ghc.ghcVersion;
checkPhase = stdenv.lib.optional self.doCheck ''
eval "$preCheck"
./Setup test
./Setup test ${self.testTarget}
eval "$postCheck"
'';