tests: show the test name and number at the start of verbose output
authorSZEDER Gábor <szeder.dev@gmail.com>
Mon, 5 Aug 2019 21:04:47 +0000 (23:04 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Aug 2019 22:21:33 +0000 (15:21 -0700)
commitffe1afe67c0fab1786ad2aa9668efabe773f73c3
treecd6a093618e558e4f41f5ad153c9cfbb2f2c7215
parent96f3ccc2abf81520740de857471ab6b200f0ea3b
tests: show the test name and number at the start of verbose output

The verbose output of every test looks something like this:

  expecting success:
          echo content >file &&
          git add file &&
          git commit -m "add file"

  [master (root-commit) d1fbfbd] add file
   Author: A U Thor <author@example.com>
   1 file changed, 1 insertion(+)
   create mode 100644 file
  ok 1 - commit works

i.e. first an "expecting success" (or "checking known breakage") line
followed by the commands to be executed, then the output of those
comamnds, and finally an "ok"/"not ok" line containing the test name.
Note that the test's name is only shown at the very end.

With '-x' tracing enabled and/or in longer tests the verbose output
might be several screenfulls long, making it harder than necessary to
find where the output of the test with a given name starts (especially
when the outputs to different file descriptors are racing, and the
"expecting success"/command block arrives earlier than the "ok" line
of the previous test).

Print the test name at the start of the test's verbose output, i.e. at
the end of the "expecting success" and "checking known breakage"
lines, to make the start of a particular test a bit easier to
recognize.  Also print the test script and test case numbers, to help
those poor souls who regularly have to scan through the combined
verbose output of several test scripts.

So the dummy test above would start like this:

  expecting success of 9999.1 'commit works':
          echo content >file &&
  [...]

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t0000-basic.sh
t/test-lib-functions.sh
t/test-lib.sh