forked from mirrors/nixpkgs
Merge pull request #126364 from sternenseemann/haskell-test-flags
haskell-generic-builder: allow passing flags to the test suite(s)
This commit is contained in:
commit
222b6c80ac
|
@ -1928,9 +1928,7 @@ EOT
|
|||
# Disable flaky tests
|
||||
# https://github.com/DavidEichmann/alpaca-netcode/issues/2
|
||||
alpaca-netcode = overrideCabal super.alpaca-netcode {
|
||||
# use testTarget to also pass some flags to the test suite.
|
||||
# TODO: We should add proper support for this to the builder.
|
||||
testTarget = "test --test-options='-p \"!/[NOCI]/\"'";
|
||||
testFlags = [ "--pattern" "!/[NOCI]/" ];
|
||||
};
|
||||
|
||||
# Tests require to run a binary which isn't built
|
||||
|
@ -1941,8 +1939,7 @@ EOT
|
|||
# this, run tests with only a single job.
|
||||
# https://github.com/vmchale/libarchive/issues/20
|
||||
libarchive = overrideCabal super.libarchive {
|
||||
# TODO: We should add proper support for this to the builder.
|
||||
testTarget = "libarchive-test --test-options='-j1'";
|
||||
testFlags = [ "-j1" ];
|
||||
};
|
||||
|
||||
# unrestrict bounds for hashable and semigroups
|
||||
|
|
|
@ -58,7 +58,7 @@ in
|
|||
, pkg-configDepends ? [], libraryPkgconfigDepends ? [], executablePkgconfigDepends ? [], testPkgconfigDepends ? [], benchmarkPkgconfigDepends ? []
|
||||
, testDepends ? [], testHaskellDepends ? [], testSystemDepends ? [], testFrameworkDepends ? []
|
||||
, benchmarkDepends ? [], benchmarkHaskellDepends ? [], benchmarkSystemDepends ? [], benchmarkFrameworkDepends ? []
|
||||
, testTarget ? ""
|
||||
, testTarget ? "", testFlags ? []
|
||||
, broken ? false
|
||||
, preCompileBuildDriver ? null, postCompileBuildDriver ? null
|
||||
, preUnpack ? null, postUnpack ? null
|
||||
|
@ -454,9 +454,13 @@ stdenv.mkDerivation ({
|
|||
|
||||
inherit doCheck;
|
||||
|
||||
# Run test suite(s) and pass `checkFlags` as well as `checkFlagsArray`.
|
||||
# `testFlags` are added to `checkFlagsArray` each prefixed with
|
||||
# `--test-option`, so Cabal passes it to the underlying test suite binary.
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
${setupCommand} test ${testTarget}
|
||||
checkFlagsArray+=(${lib.escapeShellArgs (builtins.map (opt: "--test-option=${opt}") testFlags)})
|
||||
${setupCommand} test ${testTarget} $checkFlags ''${checkFlagsArray:+"''${checkFlagsArray[@]}"}
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
|
|
Loading…
Reference in a new issue