diff options
| author | Miguel Ojeda <ojeda@kernel.org> | 2025-07-26 21:07:50 +0300 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2025-08-24 16:29:51 +0300 |
| commit | 17d5efcbfe6f3da23afb79d84c27cefb2b3f331a (patch) | |
| tree | 60f2a68ddbc19d7bf3f3df2168f07ad3ba1e5ea5 /rust/Makefile | |
| parent | ac9eea3d08c25fb213deb113d246ff5dadb31fbc (diff) | |
| download | linux-17d5efcbfe6f3da23afb79d84c27cefb2b3f331a.tar.xz | |
rust: kernel: remove support for unused host `#[test]`s
Since commit 028df914e546 ("rust: str: convert `rusttest` tests into
KUnit"), we do not have anymore host `#[test]`s that run in the host.
Moreover, we do not plan to add any new ones -- tests should generally
run within KUnit, since there they are built the same way the kernel
does. While we may want to have some way to define tests that can also
be run outside the kernel, we still want to test within the kernel too
[1], and thus would likely use a custom syntax anyway to define them.
Thus simplify the `rusttest` target by removing support for host
`#[test]`s for the `kernel` crate.
This still maintains the support for the `macros` crate, even though we
do not have any such tests there.
Link: https://lore.kernel.org/rust-for-linux/CABVgOS=AKHSfifp0S68K3jgNZAkALBr=7iFb=niryG5WDxjSrg@mail.gmail.com/ [1]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Reviewed-by: David Gow <davidgow@google.com>
Link: https://lore.kernel.org/r/20250726180750.2735836-1-ojeda@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'rust/Makefile')
| -rw-r--r-- | rust/Makefile | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/rust/Makefile b/rust/Makefile index 4263462b8470..a934946bbf21 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -238,7 +238,7 @@ quiet_cmd_rustc_test = $(RUSTC_OR_CLIPPY_QUIET) T $< $(objtree)/$(obj)/test/$(subst rusttest-,,$@) $(rust_test_quiet) \ $(rustc_test_run_flags) -rusttest: rusttest-macros rusttest-kernel +rusttest: rusttest-macros rusttest-macros: private rustc_target_flags = --extern proc_macro \ --extern macros --extern kernel --extern pin_init @@ -248,13 +248,6 @@ rusttest-macros: $(src)/macros/lib.rs \ +$(call if_changed,rustc_test) +$(call if_changed,rustdoc_test) -rusttest-kernel: private rustc_target_flags = --extern ffi --extern pin_init \ - --extern build_error --extern macros --extern bindings --extern uapi -rusttest-kernel: $(src)/kernel/lib.rs rusttestlib-ffi rusttestlib-kernel \ - rusttestlib-build_error rusttestlib-macros rusttestlib-bindings \ - rusttestlib-uapi rusttestlib-pin_init FORCE - +$(call if_changed,rustc_test) - ifdef CONFIG_CC_IS_CLANG bindgen_c_flags = $(c_flags) else |
