From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EDED7F for ; Wed, 14 Jun 2023 18:09:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAA94C433C0; Wed, 14 Jun 2023 18:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686766161; bh=fXHMpfERvexjC1cBZRBzlkhrqEdvS6t8XukfGExQ9rE=; h=From:To:Cc:Subject:Date:From; b=T0w5Clw6D4NpCHTogWpArssUXW2986IdhYro40TmZhV+LtKFz6dSaRaikAvt5XheN gns0l1bPss9Nt4D/PIWJTOti/EYwrF5vvVwflkW8e5n1OccZ39RQNJ9l4K29zn/qQ0 Yhc31ewVSDSm5RRWPdKyHSSFaFETQYbBMr2xeZh+9eYsg5ov906SSTX52WUs38mQtF AAaZlNB2T49Ix361pzTvDWu0aqP/ZDnjPAlSTdJzy3QgCUYIZaua0jK/tzd4TuS17p 0DRXPAM1lXrOe1bf0wqzLqcfJXNaIrXp85SBe8sLyJIgec60v35blJICTjgZAAh/Wq veL2T6ul3pjPw== From: Miguel Ojeda To: David Gow , Brendan Higgins , Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Alice Ryhl , Andreas Hindborg , Philip Li , kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: [PATCH 0/6] KUnit integration for Rust doctests Date: Wed, 14 Jun 2023 20:08:24 +0200 Message-ID: <20230614180837.630180-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This is the initial KUnit integration for running Rust documentation tests within the kernel. Thank you to the KUnit team for all the input and feedback on this over the months, as well as the Intel LKP 0-Day team! This may be merged through either the KUnit or the Rust trees. If the KUnit team wants to merge it, then that would be great. Please see the message in the main commit for the details. Miguel Ojeda (6): rust: init: make doctests compilable/testable rust: str: make doctests compilable/testable rust: sync: make doctests compilable/testable rust: types: make doctests compilable/testable rust: support running Rust documentation tests as KUnit ones MAINTAINERS: add Rust KUnit files to the KUnit entry MAINTAINERS | 2 + lib/Kconfig.debug | 13 +++ rust/.gitignore | 2 + rust/Makefile | 29 ++++++ rust/bindings/bindings_helper.h | 1 + rust/helpers.c | 7 ++ rust/kernel/init.rs | 25 +++-- rust/kernel/kunit.rs | 156 ++++++++++++++++++++++++++++ rust/kernel/lib.rs | 2 + rust/kernel/str.rs | 4 +- rust/kernel/sync/arc.rs | 9 +- rust/kernel/sync/lock/mutex.rs | 1 + rust/kernel/sync/lock/spinlock.rs | 1 + rust/kernel/types.rs | 6 +- scripts/.gitignore | 2 + scripts/Makefile | 4 + scripts/rustdoc_test_builder.rs | 73 ++++++++++++++ scripts/rustdoc_test_gen.rs | 162 ++++++++++++++++++++++++++++++ 18 files changed, 484 insertions(+), 15 deletions(-) create mode 100644 rust/kernel/kunit.rs create mode 100644 scripts/rustdoc_test_builder.rs create mode 100644 scripts/rustdoc_test_gen.rs base-commit: d2e3115d717197cb2bc020dd1f06b06538474ac3 -- 2.41.0