[LTP] [PATCH 0/2] lib: Add TINFO_WARN

Petr Vorel pvorel@suse.cz
Thu Jun 20 13:25:14 CEST 2024


> Hi Petr, All,

> On Thu, Jun 20, 2024 at 1:36 PM Petr Vorel <pvorel@suse.cz> wrote:

> > > Hi!
> > > > I'm not sure about this. Why not enabling TINFO + TWARN combination
> > instead?

> > > > tst_res(TINFO | TWARN, "my message");

> > > That's even more confusing. Does that propagate into results or not?

> > > To be honest we even have problem deciding if we should use TINFO or
> > > TWARN in some cases and adding third variant would make things even
> > > worse, sicne we would have three options.

> > > So I would really keep just TINFO which is something that is printed by
> > > default but does not propagate into results and TWARN that is printed as
> > > well but propagates into results.

> > > Maybe it would be even better to actually remove TWARN. That way we
> > > would have only TFAIL and TBROK that propagate into results since TWARN
> > > is kind of lesser TBROK anyways...

> > Understand to your points. But tst_res TWARN is quite understandable
> > (simple warning, which propagates), IMHO better to use than
> > tst_res TBROK. But sure, feel free to go ahead and send a patch to remove
> > TWARN.


> +1 to remove TWARN.


> > BTW I was also surprised how many tests use tst_resm TBROK ... /
> > tst_resm(TBROK,
> > ...) followed by exit 1 / exit(1). These should be converted to tst_brkm
> > TBROK /
> > tst_resm(TBROK, ...).

> > Other thing is, that I would prefer to have macro for tst_res(TINFO,
> > "WARNING: ...")
> > e.g. WARNING(...) would produce tst_res(TINFO, "WARNING: ...") from simple
> > point I
> > don't like to hardwire text (there can be typos). BTW more than for this
> > rare
> > case I would prefer to have macros for .tags, e.g. LINUX_GIT(43a6684519ab)
> > would
> > produce {"linux-git", "43a6684519ab"} CVE(2017-2671) would produce {"CVE",
> > "2017-2671"}
> > (again, typos).


> What about defining new LTP macros like
>   TST_RES_TINFO(),
>   TST_RES_TFAIL(),
>   ...
>   TST_RES_WARNING(),
> so that we can save time on inputting the TFAIL/TINFO keywords every time?

> also TST_LINUX_GIT(), TST_CVE() ?

+1


More information about the ltp mailing list