Closed
Bug 648127
Opened 13 years ago
Closed 13 years ago
A test failure right after something is dumped without a trailing \n goes unnoticed
Categories
(Testing :: XPCShell Harness, defect)
Testing
XPCShell Harness
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla6
People
(Reporter: rain1, Assigned: rain1)
References
Details
Attachments
(1 file, 3 obsolete files)
4.96 KB,
patch
|
ted
:
review+
|
Details | Diff | Splinter Review |
STR: Create an xpcshell test with the following code: function run_test() { dump("foo"); do_check_true(false); } The test will pass even though it should fail. Attached is a WIP patch that prints newlines before each TEST-UNEXPECTED-FAIL, per ted's recommendation. The patch is currently running through the tryserver. Jason, you wrote the code that prints parent/child for xpcshell tests. Do you know why some but not all the TEST-UNEXPECTED-FAIL statements use _dump()?
Assignee | ||
Comment 1•13 years ago
|
||
Attachment #524271 -
Attachment is obsolete: true
Attachment #524439 -
Flags: review?(ted.mielczarek)
Updated•13 years ago
|
Attachment #524439 -
Flags: review?(ted.mielczarek) → review+
Assignee | ||
Comment 2•13 years ago
|
||
Assignee | ||
Comment 3•13 years ago
|
||
I'm a bit short on time to tend to the tree right now, so it'd be great if someone else checked this in.
Keywords: checkin-needed
Comment 4•13 years ago
|
||
Comment on attachment 526715 [details] [diff] [review] Patch to check in The "newline" parameter strikes me as gross. What we're trying to do here is make sure any TEST-UNEXPECTED-FAIL shows up at the start of a line. Seems cleaner to just add a "test_unexpected_fail()" function that prepends "\nTEST-UNEXPECTED-FAIL | " (or "\nTEST-UNEXPECTED-FAIL | (xpcshell/head.js) | ": we're not consistent in our usage) to whatever string it gets.
Comment 5•13 years ago
|
||
> why some but not all the TEST-UNEXPECTED-FAIL statements use _dump()?
They should all use _dump, as should any "top-level" logging statement (i.e. printing "TEST-INFO" should use it on line 488, but is currently using dump: let's fix that), but if you're just printing supplemental info for a previous _dump (like dumping out stack info) you can use dump if you don't want each line to state if it comes from the parent or child.
Assignee | ||
Comment 6•13 years ago
|
||
(In reply to comment #4) > Comment on attachment 526715 [details] [diff] [review] > Patch to check in > > The "newline" parameter strikes me as gross. > > What we're trying to do here is make sure any TEST-UNEXPECTED-FAIL shows up at > the start of a line. Seems cleaner to just add a "test_unexpected_fail()" > function that prepends "\nTEST-UNEXPECTED-FAIL | " (or "\nTEST-UNEXPECTED-FAIL > | (xpcshell/head.js) | ": we're not consistent in our usage) to whatever string > it gets. Yeah the newline parameter was a hack. I'll put up an updated patch when I have the chance.
Keywords: checkin-needed
Comment 7•13 years ago
|
||
Maybe an even simpler idea: just have _dump check for 'TEST-' at start of message, and print \n first if it's a match. That would ensure that all the TEST- results start on a newline, not just TEST-UNEXPECTED-FAILURE.
Assignee | ||
Comment 8•13 years ago
|
||
Yeah, that sounds best.
Attachment #524439 -
Attachment is obsolete: true
Attachment #526715 -
Attachment is obsolete: true
Attachment #528205 -
Flags: review?(ted.mielczarek)
Comment 9•13 years ago
|
||
Comment on attachment 528205 [details] [diff] [review] patch v2 Review of attachment 528205 [details] [diff] [review]: This is fine too.
Attachment #528205 -
Flags: review?(ted.mielczarek) → review+
Assignee | ||
Comment 10•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/8f79761f3ea6
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla6
You need to log in
before you can comment on or make changes to this bug.
Description
•