Ticket #3986 (closed enhancement: fixed)

Opened 6 years ago

Last modified 4 years ago

.log output for tests are b0rked

Reported by: howaboutsynergy Owned by: andrew_b
Priority: major Milestone: 4.8.27
Component: tests Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

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)

Attachments

mc-3986-tests-donot-write-parallel-to-logfile.patch (48.4 KB) - added by and 4 years ago.

Change History

comment:1 Changed 6 years 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 6 years ago by howaboutsynergy (previous) (diff)

comment:2 Changed 4 years ago by and

Thanks howaboutsynergy for your insane post at gitsoft.
Lets print test logging output to stdout and save by automake to logfile.

comment:3 Changed 4 years ago by zaytsev

  • Milestone changed from Future Releases to 4.8.27

comment:4 Changed 4 years ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • Branch state changed from no branch to on review

comment:5 Changed 4 years ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from on review to approved

comment:6 Changed 4 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged
Last edited 4 years ago by andrew_b (previous) (diff)

comment:7 Changed 4 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.