rust/hooks: move tests to hooks and add to passthru
This commit is contained in:
parent
db4cf6cb1d
commit
154f977ac6
@ -17,8 +17,9 @@
|
||||
# `target/` from which to copy the build artifacts. It is derived
|
||||
# from a stdenv platform (or a JSON file).
|
||||
target ? stdenv.targetPlatform.rust.cargoShortTarget,
|
||||
tests,
|
||||
pkgsCross,
|
||||
}:
|
||||
|
||||
{
|
||||
cargoBuildHook = callPackage (
|
||||
{ }:
|
||||
@ -27,6 +28,13 @@
|
||||
substitutions = {
|
||||
inherit (stdenv.targetPlatform.rust) rustcTarget;
|
||||
};
|
||||
passthru.tests =
|
||||
{
|
||||
test = tests.rust-hooks.cargoBuildHook;
|
||||
}
|
||||
// lib.optionalAttrs (stdenv.isLinux) {
|
||||
testCross = pkgsCross.riscv64.tests.rust-hooks.cargoBuildHook;
|
||||
};
|
||||
} ./cargo-build-hook.sh
|
||||
) { };
|
||||
|
||||
@ -37,6 +45,13 @@
|
||||
substitutions = {
|
||||
inherit (stdenv.targetPlatform.rust) rustcTarget;
|
||||
};
|
||||
passthru.tests =
|
||||
{
|
||||
test = tests.rust-hooks.cargoCheckHook;
|
||||
}
|
||||
// lib.optionalAttrs (stdenv.isLinux) {
|
||||
testCross = pkgsCross.riscv64.tests.rust-hooks.cargoCheckHook;
|
||||
};
|
||||
} ./cargo-check-hook.sh
|
||||
) { };
|
||||
|
||||
@ -47,6 +62,13 @@
|
||||
substitutions = {
|
||||
targetSubdirectory = target;
|
||||
};
|
||||
passthru.tests =
|
||||
{
|
||||
test = tests.rust-hooks.cargoInstallHook;
|
||||
}
|
||||
// lib.optionalAttrs (stdenv.isLinux) {
|
||||
testCross = pkgsCross.riscv64.tests.rust-hooks.cargoInstallHook;
|
||||
};
|
||||
} ./cargo-install-hook.sh
|
||||
) { };
|
||||
|
||||
@ -58,6 +80,13 @@
|
||||
substitutions = {
|
||||
inherit (stdenv.targetPlatform.rust) rustcTarget;
|
||||
};
|
||||
passthru.tests =
|
||||
{
|
||||
test = tests.rust-hooks.cargoNextestHook;
|
||||
}
|
||||
// lib.optionalAttrs (stdenv.isLinux) {
|
||||
testCross = pkgsCross.riscv64.tests.rust-hooks.cargoNextestHook;
|
||||
};
|
||||
} ./cargo-nextest-hook.sh
|
||||
) { };
|
||||
|
||||
@ -86,6 +115,13 @@
|
||||
}crt-static" ]
|
||||
'';
|
||||
};
|
||||
passthru.tests =
|
||||
{
|
||||
test = tests.rust-hooks.cargoSetupHook;
|
||||
}
|
||||
// lib.optionalAttrs (stdenv.isLinux) {
|
||||
testCross = pkgsCross.riscv64.tests.rust-hooks.cargoSetupHook;
|
||||
};
|
||||
} ./cargo-setup-hook.sh
|
||||
) { };
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
*/
|
||||
cargoSetupHook = stdenv.mkDerivation {
|
||||
name = "test-cargoSetupHook";
|
||||
src = ./hello;
|
||||
src = ./example-rust-project;
|
||||
cargoVendorDir = "hello";
|
||||
nativeBuildInputs = [
|
||||
rustPlatform.cargoSetupHook
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
cargoBuildHook = stdenv.mkDerivation {
|
||||
name = "test-cargoBuildHook";
|
||||
src = ./hello;
|
||||
src = ./example-rust-project;
|
||||
cargoBuildType = "release";
|
||||
"CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER" =
|
||||
"${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
|
||||
@ -44,7 +44,7 @@
|
||||
|
||||
cargoInstallHook = stdenv.mkDerivation {
|
||||
name = "test-cargoInstallHook";
|
||||
src = ./hello;
|
||||
src = ./example-rust-project;
|
||||
cargoBuildType = "release";
|
||||
"CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER" =
|
||||
"${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
|
||||
@ -60,7 +60,7 @@
|
||||
|
||||
cargoCheckHook = stdenv.mkDerivation {
|
||||
name = "test-cargoCheckHook";
|
||||
src = ./hello;
|
||||
src = ./example-rust-project;
|
||||
cargoBuildType = "release";
|
||||
"CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER" =
|
||||
"${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
|
||||
@ -82,7 +82,7 @@
|
||||
|
||||
cargoNextestHook = stdenv.mkDerivation {
|
||||
name = "test-cargoNextestHook";
|
||||
src = ./hello;
|
||||
src = ./example-rust-project;
|
||||
cargoBuildType = "release";
|
||||
"CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER" =
|
||||
"${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
|
@ -211,5 +211,5 @@ with pkgs;
|
||||
|
||||
build-environment-info = callPackage ./build-environment-info { };
|
||||
|
||||
rust-hooks = recurseIntoAttrs (callPackages ./rust-hooks { });
|
||||
rust-hooks = recurseIntoAttrs (callPackages ../build-support/rust/hooks/test { });
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user