-
Notifications
You must be signed in to change notification settings - Fork 2
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
_indent() is a private method of Test::Builder #2
Comments
There should be some way to indent, also in TB2. I was so happy to find that internal method The ok+structured_diagnostics thing will probably not change soon, by the nature of TAP, as you said. In our TAP-centric test infrastructure Tapper we always run "prove -m" |
Ah, and BTW, why not integrate the whole Test::TAPv13 functionality into TB2? |
The real complication is this: Test::Builder 1.5 is no longer wielded to TAP. There's a multitude of different formatters now. Rather than test libraries crafting output directly, they send events which are used by the formatters to produce output. "Indent this output" or even "output this exactly" is not a concept that makes sense in Test::Builder 1.5, because a test library doesn't know what format the program has chosen (it could introspect and look, but don't do that). Meta-data associated with a test result has been in the plans for some time, but Test::TAPv13's implementation doesn't make sense for Test::Builder 1.5. It would instead be additional data associated with Result, TestStart and TestEnd events. Potentially any event could have a hash of extra data attached to it. I put this on hold because I need to concentrate on stabilizing Test::Builder 1.5, but you could work on it. Starting with something simple like is(). File and line information is already part of the result object and the "# Failed test" line is produced by the formatter from event information. Try changing TB2::Formatter::TAP::Base to produce structured diagnostics from a result. Try adding the have/want information to a result from is() and format that. |
bump With the release of Test2 this problem is once again surfacing. Here are some possible paths forward:
I recommend doing both of these. You can write the YAML event and fire it off instead of doing what you do now. The TAPv13 formatter can output the TAP 13 header/pragma, and can write YAML output correctly according to spec. Using the generic interface the YAML can be rendered as comments, or hidden entirely in non-TAP13 formatters. Your module here could then simply provide the function to fire off YAML events, and also load/set the formatter. |
ACK. I will have a look. Steffen Chad Granum [email protected] writes:
Steffen Schwigon [email protected] |
I just marked this issue in RT as WONTFIX and uploaded a new version with a DEPRECATION hint in Changelog. |
This is going to break in Test::Builder1.5.
Unfortunately, I don't have a better way to do it right now.
In addition, the Test::Builder structured diagnostic design is unlikely to follow the pattern of:
and instead do them either as a single call or building a single object. This is so that the result and diagnostics can be formatted as one. TAP is special in allowing them to be separate.
Sooo... I'm not sure what happens to this module in Test::Builder1.5 space. For the moment maybe detect a Test::Builder::VERSION >= 1.5 and die with a nice error message?
The text was updated successfully, but these errors were encountered: