Ticket #3986 (new enhancement)

Opened 5 days ago

Last modified 4 days ago

.log output for tests are b0rked

Reported by: howaboutsynergy Owned by:
Priority: major Milestone: Future Releases
Component: tests Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

the log files for the tests are b0rked because test-driver (script created by autotools?) is redirecting stdout to the same .log file that the test(s) are writing to via srunner_set_log().

As a workaround, is enough to just change eg. srunner_set_log (sr, "do_cd_command.log"); to srunner_set_log (sr, "-"); in each script, so that now both test-driver and the test(s) are using the same descriptor for the log file output.
(details in https://github.com/libcheck/check/issues/188 )

Result with the above change, is:

$ cat do_cd_command.log 
Running suite(s): /src/filemanager
Running suite /src/filemanager
do_cd_command.c:147:P:Core:test_empty_mean_home:0: Passed
do_cd_command.c:147:P:Core:test_empty_mean_home:1: Passed
do_cd_command.c:147:P:Core:test_empty_mean_home:2: Passed
do_cd_command.c:147:P:Core:test_empty_mean_home:3: Passed
100%: Checks: 4, Failures: 0, Errors: 0
Results for all suites run:
100%: Checks: 4, Failures: 0, Errors: 0
PASS do_cd_command (exit status: 0)

before, it was:

$ cat do_cd_command.log 
Running suite /src/filemanager
do_c100%: Checks: 4, Failures: 0, Errors: 0
ome:0: Passed
do_cd_command.c:147:P:Core:test_empty_mean_home:1: Passed
do_cd_command.c:147:P:Core:test_empty_mean_home:2: Passed
do_cd_command.c:147:P:Core:test_empty_mean_home:3: Passed
Results for all suites run:
100%: Checks: 4, Failures: 0, Errors: 0
PASS do_cd_command (exit status: 0)

Should I attempt a patch with the specified workaround? (it would be my first mc patch, and yes I will have to read on the code formatting rules: https://midnight-commander.org/wiki/Hacking and other things)

Change History

comment:1 Changed 4 days ago by howaboutsynergy

On second thought, maybe applying that workaround is a bad idea because according to this comment https://github.com/libcheck/check/issues/188#issuecomment-492915938 it seems that only newer Automake decided to log the output to the same log file name(via test-driver script). So, because the older Automake didn't do that before, then applying the workaround suggested by me above would result in the tests logging their output to stdout instead of in the log file, for anyone running them with older Automake tools.

Last edited 4 days ago by howaboutsynergy (previous) (diff)
Note: See TracTickets for help on using tickets.