Ticket #3986 (closed enhancement: fixed)
.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
Change History
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: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
Branch: 3986_tests_logs
changeset:227f03238c5f6616c020cc1c558d1c170b829679
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
Merged to master: [984df818328a2eb46b0a8e0399a27c61ef3886a4].
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.