[LTP] [RFC PATCH 1/2] lib: add TST_RES_ serious macros

Li Wang liwang@redhat.com
Wed Jun 26 15:16:21 CEST 2024


Hi Cyril and Andrea,

Cyril Hrubis <chrubis@suse.cz> wrote:


>
> > The macros handle various scenarios including simple messages and
> messages
> > with error flags, ensuring consistent logging of file and line
> information.
> >
> > Additionally, a new test case in tst_res_macros.c demonstrates the usage
> > of these macros.
>
> I actually like the function better. It makes sense to add macros when
> they do something more complicated e.g. the TST_EXP_ macros save a lot
> of code, but in this case I do not think that they add any value, the
> change is only cosmetic.
>

Thanks for the feedback, I admit that those macros are a bit redundant.

But back to the starting point [1], my original intention was just to mask
TWARN
as a failure in the test log. It keeps boring our engineers when reviewing
the warnings
in the automation job.

What about just adding one macro to save energy on TWARN review?

 #define TST_RES_TWARN(MESSAGE, ...) \
        tst_res(TINFO, "WARNING: "MESSAGE, ##__VA_ARGS__)

[1] https://lists.linux.it/pipermail/ltp/2024-May/038561.html

-- 
Regards,
Li Wang


More information about the ltp mailing list