Regression: Add ANSI colours to highlight test status
Review Request #1137 - Created April 6, 2012 and submitted
| Information | |
|---|---|
| Andreas Hansson | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Regression: Add ANSI colours to highlight test status This patch adds a very basic pretty-printing of the test status (passed or failed) to highlight failing tests even more: green for passed, and red for failed. The printing only uses ANSI it the target output is a tty and supports ANSI colours. Hence, any regression scripts that are outputting to files or sending e-mails etc should still be fine.
Ran util/regress in a terminal and also through regression script
Posted (April 6, 2012, 2:48 a.m.)
-
tests/SConscript (Diff revision 1) -
Can you access the use_colors variable from the top level sconscript? it has already figured this out.
-
tests/SConscript (Diff revision 1) -
Colors are already defined in m5.util.termcap so you can have termcap.Yellow or termcap.Blue
Posted (April 6, 2012, 2:54 a.m.)
-
tests/SConscript (Diff revision 1) -
Can't you roll all this into the existing color code in src/python/m5/terminal.py? You should probably do an Export('terminal') in the SConstruct file so you can get access to the stuff easily. (Or move the if clause into terminal.py)
Review request changed
Updated (April 6, 2012, 4:37 a.m.)
Diff: |
Revision 2 (+33 -1) |
|---|
Posted (April 6, 2012, 4:54 a.m.)
-
tests/SConscript (Diff revision 2) -
I really hate to see this code duplicated. Why not stick termcap in the environment or better yet move the code into terminal.py and call it get_termcap(use_colors=None)
Posted (April 6, 2012, 5:40 a.m.)
I'm all for code that makes reading the regression output easier. Other possible ideas: 1. Supress non-pass/fail information so the relevant lines don't scroll right off the screen, forcing a rerun to get a summary (may already be possible?) 2. Sort passes and fails so fails are last and grouped together. 3. It's nice to see things pass/fail as they finish, so maybe let them finish normally while collecting results. Then sort them into passes and fails, and print a summary with passes in one group, fails in another, and maybe even a count of each. Then you can see if your super fast test failed right away without waiting for the slow one, and after all the regressions run all night, you don't have to run them again to actually see what happened. And failures won't be lost in the crowd. 4. Send the summary/sorted list in the emails. We've had failures we didn't see for a while because they were surrounded by a bunch of passes.
Ship It!
Love it. Sorry to make you jump through so many hoops for a patch that is so trivial.
