[LTP] [PATCH v4 1/3] lib: Add support option for .needs_cmds

Petr Vorel pvorel@suse.cz
Fri Oct 17 16:35:24 CEST 2025


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?

Kind regards,
Petr


More information about the ltp mailing list