lkml.org 
[lkml]   [2022]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/7] perf test: Skip reason for suites with 1 test
On Thu, May 12, 2022 at 9:05 PM Ian Rogers <irogers@google.com> wrote:
>
> When a suite has just 1 subtest, the subtest number is given as -1 to
> avoid indented printing. When this subtest number is seen for the skip
> reason, use the reason of the first test.
>
> Signed-off-by: Ian Rogers <irogers@google.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung


> ---
> tools/perf/tests/builtin-test.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
> index fac3717d9ba1..33fcafa0fa79 100644
> --- a/tools/perf/tests/builtin-test.c
> +++ b/tools/perf/tests/builtin-test.c
> @@ -137,10 +137,10 @@ static bool has_subtests(const struct test_suite *t)
>
> static const char *skip_reason(const struct test_suite *t, int subtest)
> {
> - if (t->test_cases && subtest >= 0)
> - return t->test_cases[subtest].skip_reason;
> + if (!t->test_cases)
> + return NULL;
>
> - return NULL;
> + return t->test_cases[subtest >= 0 ? subtest : 0].skip_reason;
> }
>
> static const char *test_description(const struct test_suite *t, int subtest)
> --
> 2.36.0.550.gb090851708-goog
>

\
 
 \ /
  Last update: 2022-05-17 05:54    [W:0.142 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site