-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
diag() printing to stdout vs stderr #11
Comments
The commit message of commit a2471c1 consistently references stderr instead of stdout but writes to stdout. @rra, could this have been an oversight in the original commit? Author: Russ Allbery [email protected]
` +/*
+/*
|
There are two different problems here, one of which is a long-standing missing feature and one of which was (I think) intentional but an unfortunate mismatch with Perl's terminology that should probably be fixed. Perl's test framework distinguishes between Separately, Perl's harness passes through stderr, which frequently results in very messy and ugly output but which does mean that the errors are more visible. My intent was to capture stderr and display it more intelligently than Perl does, after the failed test, but I've never gotten around to implementing that. (It's the sort of thing that's kind of annoying to do in C and requires a bit of thought about the output format.) I think the correct solution to the first problem is unfortunately not backward-compatible: introduce |
Oh, and re-reading the issue, there's a third problem as well: |
The
diag()
in c-tap-harness currently prints to stdout, but the comments mention stderr:(and libtap.sh is similar)
In contrast, the
diag()
from perl's Test::More et al does actually print to stderr and I assume has for a long time. This difference can be pretty confusing, sinceruntests
from c-tap-harness discards stderr unless we run with-o
.So if you're running tests through
runtests -v
, you get diagnostic info if the test was written in C using c-tap-harness, but you don't if it's written in perl's Test::More. If a test fails, you don't know why:The behavior of c-tap-harness makes more sense to me than perl's, but I'm not familiar with the historical context here. Searching for some info finds some discussion implying this can be a contentious issue (such as https://www.nntp.perl.org/group/perl.qa/2007/03/msg8289.html ), suggesting that there may be no good fix for this.
If we just don't ignore stderr for
runtests -v
(or have a new option to let stderr through), that would let the diagnostics be visible. They'd probably be interleaved weirdly, but at least the data is there.Or if things are left alone, it could be helpful to mention this as a slight incompatibility with other TAP producers like perl's. The user can change any perl tests to show diagnostic info on stdout in the TAP stream; having a note would help explain why you're not seeing any diagnostics and what you need to do.
The text was updated successfully, but these errors were encountered: