lkml.org 
[lkml]   [2021]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/3] perf test: Pass the verbose option to shell tests
Em Mon, Jun 21, 2021 at 02:56:46PM -0700, Ian Rogers escreveu:
> Having a verbose option will allow shell tests to provide extra failure
> details when the fail or skip.
>
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
> tools/perf/tests/builtin-test.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
> index cbbfe48ab802..e1ed60567b2f 100644
> --- a/tools/perf/tests/builtin-test.c
> +++ b/tools/perf/tests/builtin-test.c
> @@ -577,10 +577,13 @@ struct shell_test {
> static int shell_test__run(struct test *test, int subdir __maybe_unused)
> {
> int err;
> - char script[PATH_MAX];
> + char script[PATH_MAX + 3];

This looks strange, i.e. if it is a _path_ _MAX_, why add 3 chars past
that max when generating a _path_? I'll drop the above hunk and keep the
rest, ok?

- Arnaldo

> struct shell_test *st = test->priv;
>
> - path__join(script, sizeof(script), st->dir, st->file);
> + path__join(script, sizeof(script) - 3, st->dir, st->file);
> +
> + if (verbose)
> + strncat(script, " -v", sizeof(script) - strlen(script) - 1);
>
> err = system(script);
> if (!err)

\
 
 \ /
  Last update: 2021-06-22 19:46    [W:2.993 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site