SimpleTest: color debug messages
boombatower - June 23, 2009 - 23:33
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | simpletest.module |
| Category: | task |
| Priority: | normal |
| Assigned: | boombatower |
| Status: | closed |
Description
Per the debug messages to be provided by #296574: Provide debug facility for general and testing it would seem logical to color them differently for easy distinguishing.
I think just using the group property of assertions should work. Look for group "debug".

#1
#2
Changed colors to whites.
#3
The last submitted patch failed testing.
#4
Test slave crapped.
#5
I think this is fairly straight forward.
#6
I'm not sure why this is a separate patch? There's no point in committing it if #296574: Provide debug facility for general and testing doesn't get in, no? Can we move this code into the patch over there?
#7
Actually if you use the group 'Debug' you can take advantage of this. Either way it seemed like a separate patch, but we can merge.
/me has been burned TOO many times over the whole large patch stuff.
#8
Ok, boombatower clarified on IRC that this patch is still useful even right now if you do something like:
$this->assertTrue(FALSE, 'message', 'Debug');However, I tried this and it sends conflicting messages. The results says "1 fail" yet none of the rows are coloured red. There's only the one grey "Debug" message row with a red X next to it. If I change it to a pass instead (assertTrue(TRUE...), then the fieldset gets collapsed and I need to explicitly expand it to read the debug message. Again, not intuitive.
Therefore, I'm not sure this makes much sense by itself. Let's roll it in with a patch that adds an explicit debug function.
#9
On IRC, Jimmy explained that this actually is a follow-up to the verbose mode patch which is already using this grouping for debug messages.
Just a question. Why use the grouping? Why not a different $assertion->status;?
#10
I would much rather not add a debug status as that would require a rewrite of parts of the code, considering these messages are purely for debug that seems a bit much.
Verbose uses the Debug group right now and #296574: Provide debug facility for general and testing will provide a function to call for general debug info. So either commit here or I can include in the other debug patch.
#12
Extremely simple followup
#13
Screenshot?
#14
Can do.
#15
Ok, committed to HEAD.
#16
Automatically closed -- issue fixed for 2 weeks with no activity.