Re: Tom Lane 2019-02-18 <28360.1550506...@sss.pgh.pa.us> > >>> We should also strive to align "FAILED" properly. > > >> Yeah, not strictly required, but someone might want to play around with > >> it a bit. > > > FWIW I don't think we localize pg_regress output currently, so that > > argument seems moot ... But I think we can get away with constant four > > spaces for now. > > I pushed Peter's suggestion for %8.0f; let's live with that for a little > and see if it's still annoying.
The ryu changes make postgresql-unit fail quite loudly: $ cat regression.out test extension ... ok 359 ms test tables ... FAILED 164 ms test unit ... FAILED 867 ms test binary ... ok 20 ms test unicode ... ok 18 ms test prefix ... FAILED 43 ms test units ... FAILED 207 ms test time ... FAILED 99 ms test temperature ... FAILED 22 ms ... The misalignment annoyed me enough (especially the false alignment between "ms" on the first row and "164" on the next row) to look into it. Aligned it looks like this: test extension ... ok 399 ms test tables ... FAILED 190 ms test unit ... FAILED 569 ms test binary ... ok 14 ms test unicode ... ok 15 ms test prefix ... FAILED 44 ms test units ... FAILED 208 ms test time ... FAILED 99 ms test temperature ... FAILED 21 ms ... It doesn't break translations because it prints the extra spaces separately. In run_single_test() (which this output is from), it simply aligns the output with FAILED. In run_schedule(), there is the 3rd output string "failed (ignored)" which is considerably longer. I aligned the output with that, but also made the timestamp field shorter so it's not too much to the right. Christoph
>From 3acba7cc50f4711abedfb61cd06b1f8e640caac5 Mon Sep 17 00:00:00 2001 From: Christoph Berg <christoph.b...@credativ.de> Date: Thu, 21 Feb 2019 10:35:19 +0100 Subject: [PATCH] Align timestamps in pg_regress output --- src/test/regress/pg_regress.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index a18a6f6c45..8080626e94 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -1794,12 +1794,14 @@ run_schedule(const char *schedule, test_function tfunc) else { status(_("FAILED")); + status(" "); /* align with failed (ignored) */ fail_count++; } } else { status(_("ok")); + status(" "); /* align with failed (ignored) */ success_count++; } @@ -1807,7 +1809,7 @@ run_schedule(const char *schedule, test_function tfunc) log_child_failure(statuses[i]); INSTR_TIME_SUBTRACT(stoptimes[i], starttimes[i]); - status(_(" %8.0f ms"), INSTR_TIME_GET_MILLISEC(stoptimes[i])); + status(_(" %5.0f ms"), INSTR_TIME_GET_MILLISEC(stoptimes[i])); status_end(); } @@ -1880,6 +1882,7 @@ run_single_test(const char *test, test_function tfunc) else { status(_("ok")); + status(" "); /* align with FAILED */ success_count++; } -- 2.20.1