[LTP] [PATCH 4/5] lib/tst_res_.c: Add TBROK handler + more verbose errors
Petr Vorel
pvorel@suse.cz
Wed Dec 11 20:36:52 CET 2024
Hi Cyril,
> Hi!
> > > We use the tst_res_ helper for tst_brk_ as well so we need to be able to
> > > handle TBROK type as well.
> > How can we call tst_brk_() via tst_res_() ?
> > tst_res_(argv[1], atoi(argv[2]), type, "%s", msg);
> In the end both of these functions increment counters, but in this case
> we need to return to the shell so we cannot call tst_brk() in the
> helper. It's a very special situation here.
Thanks for info. Maybe a little note anywhere (e.g. commit message) would help.
> > Also we have TST_RES_SUPPORTS_TCONF_TDEBUG_TFAIL_TINFO_TPASS_TWARN check to not
> > add TBROK to tst_res_().
> That only works when the value is constant, if you pass via variable
> that is not constant at build time you can pass whatever you want. Which
> is another reason why it makes sense to relax the constraints.
Good point. So you plan to remove these build time checks?
Also we have nice docs from you include/tst_res_flags.h.
ATM include/tst_test.h and doc/old/C-Test-API.asciidoc are outdated,
but if you relax allowed ttype, than it would not need to be updated.
Also, any reason to not support TWARN?
I suppose we don't need TERRNO, TTERRNO, TRERRNO (not supported by tst_test.sh).
Anyway, LGTM.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
More information about the ltp
mailing list