75ca762b89
GitOrigin-RevId: 29b0d4d0b600f8f5dd0b86e3362a33d4181938f9
41 lines
828 B
Bash
41 lines
828 B
Bash
declare -a checkFlags
|
|
|
|
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
|
|
}
|
|
|
|
if [ -z "${checkPhase-}" ]; then
|
|
checkPhase=cargoCheckHook
|
|
fi
|