rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] Rust KUnit `#[test]` support improvements
@ 2025-05-02 21:51 Miguel Ojeda
  2025-05-02 21:51 ` [PATCH 1/7] rust: kunit: support KUnit-mapped `assert!` macros in `#[test]`s Miguel Ojeda
                   ` (8 more replies)
  0 siblings, 9 replies; 40+ messages in thread
From: Miguel Ojeda @ 2025-05-02 21:51 UTC (permalink / raw)
  To: Brendan Higgins, David Gow, Miguel Ojeda, Alex Gaynor
  Cc: Rae Moar, linux-kselftest, kunit-dev, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, rust-for-linux, linux-kernel,
	patches

Improvements that build on top of the very basic `#[test]` support merged in
v6.15.

They are fairly minimal changes, but they allow us to map `assert*!`s back to
KUnit, plus to add support for test functions that return `Result`s.

In essence, they get our `#[test]`s essentially on par with the documentation
tests.

I also took the chance to convert some host `#[test]`s we had to KUnit in order
to showcase the feature.

Finally, I added documentation that was lacking from the original submission.

I hope this helps.

Miguel Ojeda (7):
  rust: kunit: support KUnit-mapped `assert!` macros in `#[test]`s
  rust: kunit: support checked `-> Result`s in KUnit `#[test]`s
  rust: add `kunit_tests` to the prelude
  rust: str: convert `rusttest` tests into KUnit
  rust: str: take advantage of the `-> Result` support in KUnit
    `#[test]`'s
  Documentation: rust: rename `#[test]`s to "`rusttest` host tests"
  Documentation: rust: testing: add docs on the new KUnit `#[test]`
    tests

 Documentation/rust/testing.rst | 80 ++++++++++++++++++++++++++++++++--
 init/Kconfig                   |  3 ++
 rust/Makefile                  |  3 +-
 rust/kernel/kunit.rs           | 29 ++++++++++--
 rust/kernel/prelude.rs         |  2 +-
 rust/kernel/str.rs             | 76 ++++++++++++++------------------
 rust/macros/helpers.rs         | 16 +++++++
 rust/macros/kunit.rs           | 31 ++++++++++++-
 rust/macros/lib.rs             |  6 ++-
 9 files changed, 191 insertions(+), 55 deletions(-)


base-commit: b4432656b36e5cc1d50a1f2dc15357543add530e
--
2.49.0

^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2025-05-28  8:03 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-02 21:51 [PATCH 0/7] Rust KUnit `#[test]` support improvements Miguel Ojeda
2025-05-02 21:51 ` [PATCH 1/7] rust: kunit: support KUnit-mapped `assert!` macros in `#[test]`s Miguel Ojeda
2025-05-04 17:41   ` Tamir Duberstein
2025-05-27  0:02     ` Miguel Ojeda
2025-05-05  6:02   ` David Gow
2025-05-27  0:08     ` Miguel Ojeda
2025-05-02 21:51 ` [PATCH 2/7] rust: kunit: support checked `-> Result`s in KUnit `#[test]`s Miguel Ojeda
2025-05-04 17:33   ` Tamir Duberstein
2025-05-04 17:59     ` Miguel Ojeda
2025-05-05  6:03       ` David Gow
2025-05-05  6:02   ` David Gow
2025-05-05 19:34     ` Boqun Feng
2025-05-06  6:32       ` David Gow
2025-05-27 15:22         ` Miguel Ojeda
2025-05-02 21:51 ` [PATCH 3/7] rust: add `kunit_tests` to the prelude Miguel Ojeda
2025-05-05  6:02   ` David Gow
2025-05-02 21:51 ` [PATCH 4/7] rust: str: convert `rusttest` tests into KUnit Miguel Ojeda
2025-05-04 17:30   ` Tamir Duberstein
2025-05-04 18:31     ` Miguel Ojeda
2025-05-04 18:39       ` Tamir Duberstein
2025-05-04 19:02         ` Miguel Ojeda
2025-05-05  6:03           ` David Gow
2025-05-05  6:02   ` David Gow
2025-05-10  1:58   ` John Hubbard
2025-05-02 21:51 ` [PATCH 5/7] rust: str: take advantage of the `-> Result` support in KUnit `#[test]`'s Miguel Ojeda
2025-05-04 17:29   ` Tamir Duberstein
2025-05-04 18:15     ` Miguel Ojeda
2025-05-04 18:22       ` Tamir Duberstein
2025-05-04 21:54         ` Miguel Ojeda
2025-05-05  6:03           ` David Gow
2025-05-05  6:02   ` David Gow
2025-05-02 21:51 ` [PATCH 6/7] Documentation: rust: rename `#[test]`s to "`rusttest` host tests" Miguel Ojeda
2025-05-05  6:02   ` David Gow
2025-05-02 21:51 ` [PATCH 7/7] Documentation: rust: testing: add docs on the new KUnit `#[test]` tests Miguel Ojeda
2025-05-05  6:02   ` David Gow
2025-05-05 16:57 ` [PATCH 0/7] Rust KUnit `#[test]` support improvements Danilo Krummrich
2025-05-05 17:07   ` Miguel Ojeda
2025-05-27  0:10 ` Miguel Ojeda
2025-05-27  0:12   ` Miguel Ojeda
2025-05-28  8:03   ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).