Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: valgrind-developers@lists.sourceforge.net, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] lib: tst_test: Add reproducible output.
Date: Fri, 9 May 2025 11:26:53 +0200	[thread overview]
Message-ID: <aB3KXdQyQciiUSes@yuki.lan> (raw)
In-Reply-To: <0a35b601-6070-4d4d-a277-4131016253e4@suse.cz>

Hi!
> >   struct results {
> >   	int passed;
> > @@ -304,6 +305,9 @@ static void print_result(const char *file, const int lineno, int ttype,
> >   	str += ret;
> >   	size -= ret;
> >   
> > +	if (reproducible_output)
> > +		goto print;
> > +
> 
> I'd move this goto one code chunk down (after the color if-else) so that 
> we also get the res string in the output. Or at least add a strncpy(str, 
> res, size) before the goto if you want to bypass the color logic.

The color output is disabled when output is redirected into a file so I
suppose that we can simply move the goto after we print the result. I
will send a v2.

-- 
Cyril Hrubis
chrubis@suse.cz

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

      reply	other threads:[~2025-05-09  9:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-09  8:34 [LTP] [PATCH] lib: tst_test: Add reproducible output Cyril Hrubis
2025-05-09  9:19 ` Martin Doucha
2025-05-09  9:26   ` Cyril Hrubis [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=aB3KXdQyQciiUSes@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=mdoucha@suse.cz \
    --cc=valgrind-developers@lists.sourceforge.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox