Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <aliceryhl@google.com>
Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/cb953202-0dbe-4127-8a8e-6a75258c2116@gmail.com
[ Reworded slightly. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Dirk Behme and committed by
Miguel Ojeda
3f4223c0 9a02cbc5

+3
+3
rust/kernel/workqueue.rs
··· 69 69 //! fn print_later(val: Arc<MyStruct>) { 70 70 //! let _ = workqueue::system().enqueue(val); 71 71 //! } 72 + //! # print_later(MyStruct::new(42).unwrap()); 72 73 //! ``` 73 74 //! 74 75 //! The following example shows how multiple `work_struct` fields can be used: ··· 127 126 //! fn print_2_later(val: Arc<MyStruct>) { 128 127 //! let _ = workqueue::system().enqueue::<Arc<MyStruct>, 2>(val); 129 128 //! } 129 + //! # print_1_later(MyStruct::new(24, 25).unwrap()); 130 + //! # print_2_later(MyStruct::new(41, 42).unwrap()); 130 131 //! ``` 131 132 //! 132 133 //! C header: [`include/linux/workqueue.h`](srctree/include/linux/workqueue.h)