All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: Mark Wielaard <mark@klomp.org>,
	Martin Cermak <mcermak@redhat.com>,
	ltp@lists.linux.it
Subject: Re: [LTP] LTP in valgrind :)
Date: Tue, 6 May 2025 10:25:38 +0200	[thread overview]
Message-ID: <20250506082538.GA66237@pevik> (raw)
In-Reply-To: <aBnCSDh8eqy38mIy@rei.lan>

Hi Cyril,

> Hi!
> > > It also opens some interesting questions, i.e. how do we make comparing
> > > results from two different tests easier. Currently they grep the test
> > > results for a summary, but maybe we can do better.

> > Kirk and compare json?

> That does sound like an overkill for something that is basically:

Agree. I sometimes think JSON output would be useful to be even in core LTP
(not requiring kirk), but that's something different than reproducible output.

The patch above LGTM (if you send patch please remember to update
doc/users/setup_tests.rst).

Kind regards,
Petr

> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index 694861d95..29d9fc1d5 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -64,6 +64,7 @@ static int mntpoint_mounted;
>  static int ovl_mounted;
>  static struct timespec tst_start_time; /* valid only for test pid */
>  static int tdebug;
> +static int reproducible_output;

>  struct results {
>         int passed;
> @@ -299,6 +300,9 @@ static void print_result(const char *file, const int lineno, int ttype,
>         str += ret;
>         size -= ret;

> +       if (reproducible_output)
> +               goto print;
> +
>         if (tst_color_enabled(STDERR_FILENO))
>                 ret = snprintf(str, size, "%s%s: %s", tst_ttype2color(ttype),
>                                res, ANSI_COLOR_RESET);
> @@ -324,6 +328,7 @@ static void print_result(const char *file, const int lineno, int ttype,
>                                 "Next message is too long and truncated:");
>         }

> +print:
>         snprintf(str, size, "\n");

>         /* we might be called from signal handler, so use write() */
> @@ -1273,6 +1278,8 @@ static void do_setup(int argc, char *argv[])
>         if (tst_test->tconf_msg)
>                 tst_brk(TCONF, "%s", tst_test->tconf_msg);

> +       reproducible_output = !!getenv("LTP_REPRODUCIBLE_OUTPUT");
> +
>         assert_test_fn();

>         TCID = tid = get_tid(argv);

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2025-05-06  8:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-29  5:22 [LTP] LTP in valgrind :) Petr Vorel
2025-04-29  6:59 ` Andrea Cervesato via ltp
2025-05-02  9:49 ` Cyril Hrubis
2025-05-02 10:53   ` Martin Doucha
2025-05-05  8:57     ` Cyril Hrubis
2025-05-05 19:52       ` Petr Vorel
2025-05-06  8:05       ` Petr Vorel
2025-05-07 15:11         ` Martin Cermak via ltp
2025-05-07 15:29           ` Cyril Hrubis
2025-05-08 16:07             ` Mark Wielaard
2025-05-09  8:24               ` Cyril Hrubis
2025-05-09 14:16               ` Bird, Tim
2025-05-12  8:09                 ` Cyril Hrubis
2025-05-08 16:40         ` Mark Wielaard
2025-05-05 19:50   ` Petr Vorel
2025-05-06  8:03     ` Cyril Hrubis
2025-05-06  8:25       ` Petr Vorel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250506082538.GA66237@pevik \
    --to=pvorel@suse.cz \
    --cc=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=mark@klomp.org \
    --cc=mcermak@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.