From: Cyril Hrubis <chrubis@suse.cz>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] LTP in valgrind :)
Date: Tue, 6 May 2025 10:03:20 +0200 [thread overview]
Message-ID: <aBnCSDh8eqy38mIy@rei.lan> (raw)
In-Reply-To: <20250505195003.GB137650@pevik>
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:
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);
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-05-06 8:05 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 [this message]
2025-05-06 8:25 ` Petr Vorel
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=aBnCSDh8eqy38mIy@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
--cc=pvorel@suse.cz \
/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