Re: [PATCH 5/6] rust: support running Rust documentation tests as KUnit ones

From: Martin Rodriguez Reboredo
Date: Thu Jun 15 2023 - 09:50:56 EST


On 6/15/23 06:23, Miguel Ojeda wrote:
On Thu, Jun 15, 2023 at 5:52 AM Martin Rodriguez Reboredo
<yakoyoku@xxxxxxxxx> wrote:

I can't remember that if this panic it will mention the path on it.
Though if it does, then use something more explicit than
`.unwrap()`.

It doesn't print it, and I am happy to make things more explicit, but
in which case(s) do you see it failing?

Please do not use unwrap here, one can easily create a path that
it's not compliant under `rust/test/doctests/kernel` and get no
clue about where this script has failed. Use `.expect()` or
something else instead.

The folder is removed every time, so that should not happen I think.
Yes, you can still hack things and call the script manually, but I
wouldn't call that "easily".

Ah, you are right, I've forgot that the folder was deleted and
remade, and because of that an error is more likely to occur at that
stage and not while `scripts/rustdoc_test_{builder,gen}.rs` is
running. Thus.

Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@xxxxxxxxx>


Nevertheless, I am happy to change it if we think there is a risk,
e.g. `rustdoc` changing the pattern (though we pin the version so
far).

Thanks for taking a look Martin!

Cheers,
Miguel