Skip to content

Commit 3f4223c

Browse files
Dirk Behmeojeda
authored andcommitted
rust: workqueue: Enable execution of doctests
Having the Rust doctests enabled these workqueue tests are built but not executed as the final callers of the print_*() functions are missing. Add them. The result is # rust_doctest_kernel_workqueue_rs_0.location: rust/kernel/workqueue.rs:35 rust_doctests_kernel: The value is: 42 ok 94 rust_doctest_kernel_workqueue_rs_0 # rust_doctest_kernel_workqueue_rs_3.location: rust/kernel/workqueue.rs:78 rust_doctests_kernel: The value is: 24 rust_doctests_kernel: The second value is: 42 ok 97 rust_doctest_kernel_workqueue_rs_3 Without this change the "The value ..." outputs are not there meaning that this test code is not run. Reviewed-by: Alice Ryhl <[email protected]> Signed-off-by: Dirk Behme <[email protected]> Reviewed-by: Boqun Feng <[email protected]> Acked-by: Tejun Heo <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Reworded slightly. - Miguel ] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 9a02cbc commit 3f4223c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rust/kernel/workqueue.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
//! fn print_later(val: Arc<MyStruct>) {
7070
//! let _ = workqueue::system().enqueue(val);
7171
//! }
72+
//! # print_later(MyStruct::new(42).unwrap());
7273
//! ```
7374
//!
7475
//! The following example shows how multiple `work_struct` fields can be used:
@@ -126,6 +127,8 @@
126127
//! fn print_2_later(val: Arc<MyStruct>) {
127128
//! let _ = workqueue::system().enqueue::<Arc<MyStruct>, 2>(val);
128129
//! }
130+
//! # print_1_later(MyStruct::new(24, 25).unwrap());
131+
//! # print_2_later(MyStruct::new(41, 42).unwrap());
129132
//! ```
130133
//!
131134
//! C header: [`include/linux/workqueue.h`](srctree/include/linux/workqueue.h)

0 commit comments

Comments
 (0)