Re: [PATCH 2/2] samples: rust: add `SgTable` and `ScatterList` selftests

From: Qingsong Chen
Date: Wed May 31 2023 - 01:30:34 EST



On 5/31/23 2:33 AM, Boqun Feng wrote:
On Tue, May 30, 2023 at 08:31:26AM +0100, Greg KH wrote:
On Tue, May 30, 2023 at 02:48:21PM +0800, Qingsong Chen wrote:
Add a selftest module to provide a temporary place to put "pure tests"
for Rust funtionality and wrappers.
Is this for in-kernel tests, or userspace tests? If userspace, you
should follow the proper test reporting protocol the rest of the kernel
uses. If in-kernel, it should follow the format that the in-kernel test
currently has to be consistent. From what I could tell here, you aren't
following either, but I might be totally wrong.

It is for in-kernel tests, and you're right, we should follow the other
in-kernel test format.

Some explanation about the background: when I was working on this little
"test framework", the Github CI of Rust-for-Linux (ab)used sample/rust/
for testing, that's why it was put there.

Now my understanding is that Rust KUnit support is coming, so we should
use kunit tests if possible.

Maybe I should place those use cases in the doc ( `Examples` section) and remove this commit

in next version. Thanks.