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

Petr Vorel pvorel@suse.cz
Thu Jun 20 07:36:18 CEST 2024


> 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.

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).

Kind regards,
Petr


More information about the ltp mailing list