STLog() macro in OCUnit would be useful
| Originator: | quinntaylor | ||
| Number: | rdar://7725705 | Date Originated: | 2010-03-06 |
| Status: | Open | Resolved: | |
| Product: | OCUnit | Product Version: | |
| Classification: | Enhancement | Reproducible: | Not Applicable |
Currently, output from OCUnit test methods written via NSLog/printf/etc. appear at the bottom of the build log when a unit test target is built. (If it is run for multiple architectures and/or under both GC and RR modes, the output appears after each run of the test bundle.) It would make debugging significantly easier if the output appeared between the "started" and "passed"/"failed" output, just as test failures do. One possibility for doing this would be to create a STLog() macro (analogous to NSLog, but which could capture __FILE__, __LINE__, and/or __func__) which accepts variadic arguments and passes the resulting string in the same way test failures are recorded. This would allow log statements to be interwoven with assertion failures so context is easier to discover. This can be useful whether the test passed or failed, and would be especially valuable for preventing output from multiple tests from getting lumped together. This enhancement is similar to the request to add a STWarn() macro that issues a warning rather than failure. <rdar://problem/5576279>
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!