Subject: Re: bug#49309: Feature Request: Automake script based tests to print the test name before running it

From: Peter Johansson <[email-masked]>
Date: Thu, 1 Jul 2021 23:30:02 +1000

Hi Kasper,

I leave to the maintainers to comment on the suggestion, but in the 
meantime...

On 1/7/21 1:01 pm, Kasper k wrote:
> Hello automake devs,
>
> In script based testsuites (https://www.gnu.org/software/automake/manual/html_node/Scripts_002dbased-Testsuites.html#Scripts_002dbased-Testsuites), when we run `make check` it prints one of the following string for each test: PASS <testname>, FAIL <testname>, XFAIL <testname> or SKIP <testname>.
>
> However, in some cases (long running test, flaky test, other inconclusive ones for more involved reasons), it is essential to know which test is currently in flight. Especially in CI systems, where flakiness every now and then, due to external factors, is almost unavoidable.
>
> It would be very helpful if a new option AM_TESTS_NAME=1 is provided, which would change the stdout output from:
>
>      <blank stdout and wait for test execution to complete>
>       PASS (or FAIL/XFAIL/SKIP) $name
>
> to something like:
>
>      RUNNING $name
>      <blank stdout and wait for test execution to complete>
>       PASS (or FAIL/XFAIL/SKIP) $name

Please note that that output comes from the test-driver script. If 
you're not happy with the default test-driver, you can declare to use 
your own my-test-driver (see 
https://www.gnu.org/software/automake/manual/automake.html#Declaring-Custom-Test-Drivers), 
and for example this could be a modified version of 'test-driver' script 
provided by Automake. Adding a line outputting 'Running $name' is 
trivial if you know any shell, or otherwise, I'm sure people here can help.

>
> this way we can easily find out the name of test (or multiple of them; in case of parallel execution) which is (are) currently running.

I usually find out which tests are running by looking at the timestamps 
of log and trace files with something like 'ls -lrt *.log *.trs'.

Cheers,

Peter