[LTP] [RFC PATCH 1/1] lib: Print in summary also tests not run at all

Petr Vorel pvorel@suse.cz
Tue Feb 1 18:39:00 CET 2022


Hi Li,

...
> Yes, I understand. So how about this way:

> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -785,6 +785,8 @@ static void print_failure_hints(void)
>         print_failure_hint("known-fail", "hit by known kernel failures", NULL);
>  }

> +static unsigned int test_variants = 1;
> +
>  static void do_exit(int ret)
>  {
>         if (results) {
> @@ -811,9 +813,11 @@ static void do_exit(int ret)
>                 fprintf(stderr, "broken   %d\n", results->broken);
>                 fprintf(stderr, "skipped  %d\n", results->skipped);
>                 fprintf(stderr, "warnings %d\n", results->warnings);
> -               fprintf(stderr, "not run  %d\n", tst_test->tcnt -
> -                               results->passed - results->failed -
> results->broken -
> -                               results->skipped - results->warnings);
> +               if (tst_test->tcnt) {
> +                       fprintf(stderr, "not-run  %d\n",
> (tst_test->tcnt * test_variants) -
> +                                       results->passed -
> results->failed - results->broken -
> +                                       results->skipped - results->warnings);
> +               }
>         }

>         do_cleanup();
> @@ -1529,7 +1533,6 @@ unsigned int tst_variant;
>  void tst_run_tcases(int argc, char *argv[], struct tst_test *self)
>  {
>         int ret = 0;
> -       unsigned int test_variants = 1;

>         lib_pid = getpid();
>         tst_test = self;

Yep, ack this one, works well. Will you please send a proper patch?

Kind regards,
Petr


More information about the ltp mailing list