Re: [PATCH v3 2/3] rust: macros: add macro to easily run KUnit tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 29, 2024 at 10:11:38PM -0700, Boqun Feng wrote:
[...]
> > +
> > +    let new_body: TokenStream = vec![body.stream(), kunit_macros.parse().unwrap()]
> > +        .into_iter()
> > +        .collect();
> > +
> > +    // Remove the `#[test]` macros.
> > +    let new_body = new_body.to_string().replace("#[test]", "");
> 
> Yeah, I want to see how you do it this time ;-) So if you do a
> `.to_string()` on a `TokenStream`, you lose all the span [1] information
> ("span information" is a term invited by me, hope I get it right ;-))

Not important: I meant I am not a procdure macro expert, hope "span
information" is what is used when discussing span preservation ;-)

Regards,
Boqun

> e.g. if there is a compile error in the test code, the compiler cannot
> report the exact line of the error, it can only report there is an
> error.
> 
[...]




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux