[LTP] [PATCH v4 1/3] lib: Add support option for .needs_cmds
Wei Gao
wegao@suse.com
Mon Oct 20 03:22:26 CEST 2025
On Fri, Oct 17, 2025 at 04:35:24PM +0200, Petr Vorel wrote:
> Hi Wei,
>
> > +++ b/include/tst_test.h
> > @@ -524,7 +524,7 @@ struct tst_fs {
> > *
> > * @tags: A {} terminated array of test tags. See struct tst_tag for details.
> > *
> > - * @needs_cmds: A NULL terminated array of commands required for the test to run.
> > + * @needs_cmds: A NULL terminated array of struct tst_cmd required for the test to run.
> > *
> > * @needs_cgroup_ver: If set the test will run only if the specified cgroup
> > * version is present on the system.
> > @@ -617,7 +617,7 @@ struct tst_fs {
>
> > const struct tst_tag *tags;
>
> > - const char *const *needs_cmds;
> > + struct tst_cmd *needs_cmds;
>
> As I wrote in all previous versions, changing struct used in struct tst_test
> alone without changing will break this particular commit.
>
> See when I apply just this commit.:
> https://github.com/pevik/ltp/actions/runs/18595891586
> https://github.com/pevik/ltp/commits/refs/heads/wei/needs_cmds.v4.first-commit-broken/
>
> CC lib/newlib_tests/tst_expiration_timer
> tst_needs_cmds01.c:15:23: error: initialization of ‘struct tst_cmd *’ from incompatible pointer type ‘const char **’ [-Wincompatible-pointer-types]
> 15 | .needs_cmds = (const char *[]) {
> | ^
> tst_needs_cmds01.c:15:23: note: (near initialization for ‘test.needs_cmds’)
>
> ...
>
> quotactl01.c:226:23: error: initialization of ‘struct tst_cmd *’ from incompatible pointer type ‘const char * const*’ [-Wincompatible-pointer-types]
> 226 | .needs_cmds = (const char *const []) {
> | ^
>
> Please you need to have this commit together with "Update test cases use new
> needs_cmds" commit into single commit (squash these two into a single commit).
>
> Or am I missing something?
Thanks for your time do verify test can review.
The reason i split this patch to small commits is easy for review, if you
need every commits can pass compile phase then i have to combine all
commits into a single big one, is that your request?
>
> Kind regards,
> Petr
More information about the ltp
mailing list