API change: `cargoParallelTestThreads` suggests that this attribute sets the number of threads used during tests, while it is actually a boolean option (use 1 thread or NIX_BUILD_CORES threads). In the hook, this is replaced by a more canonical name `dontUseCargoParallelTests`.wip/yesman
parent
9757c7101a
commit
05e40e79a8
@ -0,0 +1,37 @@ |
||||
cargoCheckHook() { |
||||
echo "Executing cargoCheckHook" |
||||
|
||||
runHook preCheck |
||||
|
||||
if [[ -n "${buildAndTestSubdir-}" ]]; then |
||||
pushd "${buildAndTestSubdir}" |
||||
fi |
||||
|
||||
if [[ -z ${dontUseCargoParallelTests-} ]]; then |
||||
threads=$NIX_BUILD_CORES |
||||
else |
||||
threads=1 |
||||
fi |
||||
|
||||
argstr="--${cargoBuildType} --target @rustTargetPlatformSpec@ --frozen"; |
||||
|
||||
( |
||||
set -x |
||||
cargo test \ |
||||
-j $NIX_BUILD_CORES \ |
||||
${argstr} -- \ |
||||
--test-threads=${threads} \ |
||||
${checkFlags} \ |
||||
${checkFlagsArray+"${checkFlagsArray[@]}"} |
||||
) |
||||
|
||||
if [[ -n "${buildAndTestSubdir-}" ]]; then |
||||
popd |
||||
fi |
||||
|
||||
echo "Finished cargoCheckHook" |
||||
|
||||
runHook postCheck |
||||
} |
||||
|
||||
checkPhase=cargoCheckHook |
Loading…
Reference in new issue