* [PATCH] risu: Add test summary
@ 2023-11-08 16:23 Sebastian Mitterle
2023-11-13 17:04 ` Thomas Huth
0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Mitterle @ 2023-11-08 16:23 UTC (permalink / raw)
To: peter.maydell; +Cc: thuth, qemu-s390x, qemu-devel
Currently, a successful test run finishes silently with exit code 0.
The last message on the console is "starting image" which can leave
the user wondering if they executed the commands correctly.
Now add a summary of the number of executed instructions in case
of success. Don't add that message when printing the trace to
stdout (`-t -`).
Tested:
a) master/apprentice mode
b) trace mode to file
c) trace mode to stdout
Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Sebastian Mitterle <smitterl@redhat.com>
---
risu.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/risu.c b/risu.c
index 36fc82a..740663a 100644
--- a/risu.c
+++ b/risu.c
@@ -551,6 +551,7 @@ int main(int argc, char **argv)
struct option *longopts;
char *shortopts;
stack_t ss;
+ int ret;
longopts = setup_options(&shortopts);
@@ -635,8 +636,15 @@ int main(int argc, char **argv)
arch_init();
if (ismaster) {
- return master();
+ ret = master();
} else {
- return apprentice();
+ ret = apprentice();
}
+
+ if (ret == EXIT_SUCCESS && (!trace || (trace && strcmp(trace_fn, "-") != 0))) {
+ fprintf(stderr, "No mismatches found. Executed %zd checkpoints.\n",
+ signal_count);
+ }
+
+ return ret;
}
--
2.41.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] risu: Add test summary
2023-11-08 16:23 [PATCH] risu: Add test summary Sebastian Mitterle
@ 2023-11-13 17:04 ` Thomas Huth
2023-11-13 17:14 ` Peter Maydell
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2023-11-13 17:04 UTC (permalink / raw)
To: Sebastian Mitterle, peter.maydell; +Cc: qemu-s390x, qemu-devel
On 08/11/2023 17.23, Sebastian Mitterle wrote:
> Currently, a successful test run finishes silently with exit code 0.
> The last message on the console is "starting image" which can leave
> the user wondering if they executed the commands correctly.
Thanks for the patch, I think this is a good idea - it also initially
puzzled me a couple of times due to the missing feedback.
> Now add a summary of the number of executed instructions in case
> of success. Don't add that message when printing the trace to
> stdout (`-t -`).
>
> Tested:
> a) master/apprentice mode
> b) trace mode to file
> c) trace mode to stdout
>
> Suggested-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Sebastian Mitterle <smitterl@redhat.com>
> ---
> risu.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/risu.c b/risu.c
> index 36fc82a..740663a 100644
> --- a/risu.c
> +++ b/risu.c
> @@ -551,6 +551,7 @@ int main(int argc, char **argv)
> struct option *longopts;
> char *shortopts;
> stack_t ss;
> + int ret;
>
> longopts = setup_options(&shortopts);
>
> @@ -635,8 +636,15 @@ int main(int argc, char **argv)
> arch_init();
>
> if (ismaster) {
> - return master();
> + ret = master();
> } else {
> - return apprentice();
> + ret = apprentice();
> }
> +
> + if (ret == EXIT_SUCCESS && (!trace || (trace && strcmp(trace_fn, "-") != 0))) {
There's a superfluous white space here ------------^
Apart from that, I wonder whether the check for trace-to-stdout is really
necessary, since you print the message to stderr below instead?
> + fprintf(stderr, "No mismatches found. Executed %zd checkpoints.\n",
> + signal_count);
> + }
> +
> + return ret;
> }
Thomas
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] risu: Add test summary
2023-11-13 17:04 ` Thomas Huth
@ 2023-11-13 17:14 ` Peter Maydell
0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2023-11-13 17:14 UTC (permalink / raw)
To: Thomas Huth; +Cc: Sebastian Mitterle, qemu-s390x, qemu-devel
On Mon, 13 Nov 2023 at 17:04, Thomas Huth <thuth@redhat.com> wrote:
>
> On 08/11/2023 17.23, Sebastian Mitterle wrote:
> > Currently, a successful test run finishes silently with exit code 0.
> > The last message on the console is "starting image" which can leave
> > the user wondering if they executed the commands correctly.
>
> Thanks for the patch, I think this is a good idea - it also initially
> puzzled me a couple of times due to the missing feedback.
>
> > Now add a summary of the number of executed instructions in case
> > of success. Don't add that message when printing the trace to
> > stdout (`-t -`).
> >
> > Tested:
> > a) master/apprentice mode
> > b) trace mode to file
> > c) trace mode to stdout
> >
> > Suggested-by: Thomas Huth <thuth@redhat.com>
> > Signed-off-by: Sebastian Mitterle <smitterl@redhat.com>
> > ---
> > risu.c | 12 ++++++++++--
> > 1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/risu.c b/risu.c
> > index 36fc82a..740663a 100644
> > --- a/risu.c
> > +++ b/risu.c
> > @@ -551,6 +551,7 @@ int main(int argc, char **argv)
> > struct option *longopts;
> > char *shortopts;
> > stack_t ss;
> > + int ret;
> >
> > longopts = setup_options(&shortopts);
> >
> > @@ -635,8 +636,15 @@ int main(int argc, char **argv)
> > arch_init();
> >
> > if (ismaster) {
> > - return master();
> > + ret = master();
> > } else {
> > - return apprentice();
> > + ret = apprentice();
> > }
> > +
> > + if (ret == EXIT_SUCCESS && (!trace || (trace && strcmp(trace_fn, "-") != 0))) {
>
> There's a superfluous white space here ------------^
>
> Apart from that, I wonder whether the check for trace-to-stdout is really
> necessary, since you print the message to stderr below instead?
Yes, we print other kinds of progress chatter to stderr and we
don't need to check for trace-to-stdout in those other places.
thanks
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-11-13 17:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-08 16:23 [PATCH] risu: Add test summary Sebastian Mitterle
2023-11-13 17:04 ` Thomas Huth
2023-11-13 17:14 ` Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).