Reduce verbosity of python version? #8
Comments
There isn't currently, I guess there are two things here:
Will implement that soon, sounds useful in general. Did you try one of my ranged test.macros? They are there to avoid that clutter |
Of those options, 2 sounds good to me! I did try using the |
Added (2), you can `set parameter metal-test-print-level " to all/warning/error to reduce the amount of output generated by gdb. This will still hit the breakpoint everytime, so your time savings might not be as awesome as you'd hope. |
…ONLY_WARNING conditions Closes #8
Added conditions for METAL_UNIT_ONLY_ERRORS and METAL_UNIT_ONLY_WARNING If you define either this will not trigger the breakpoint. Note however, that this will mess up the statistics at this point, i.e. the tests will also not show up as "executed". I will hopefulle change that later on, hence keeping the issue open. |
That was quick, thanks! Adding METAL_UNIT_ONLY_WARNINGS before It would be nicer if this could be enabled/disabled at runtime though. Maybe if void METAL_NO_INLINE __metal_unit_break(__metal_level lvl,
__metal_oper oper,
int condition,
int bitwise,
const char* str1,
const char* str2,
const char* str3,
const char* file,
int line)
{
if (condition) {
if (__metal_level_assert == lvl)
__metal_errored |= !condition;
__metal_status = condition; // Break here if METAL_ONLY_WARNINGS, METAL_ONLY_ERRORS
} else {
// GDB adds 2nd break here if *not* METAL_ONLY_WARNINGS etc is set, to log test has executed.
} |
I tried to use the conditions provided by GDB but they didn't work. I don't want to base by plugin on line numbers though, that is so easily broken, it's a maintenance nightmare. I don't get why you want to disable the |
Ah makes sense, I didn't think properly about line numbers being an issue, but it totally would be easily broken. I guess it would need to be split into two functions then which would add some overhead, and I can understand why you would not want to add that complication. I feel that disabling METAL_CALL when Regarding my tests, if I put them all in main, then to disable a group of tests (e.g, dealing with a particular peripheral/feature), I would need to comment out a bunch of lines or wrap the whole group in an |
You can just put your tests in plain functions. The only reason to use |
Understood, I have tried Should I close the pull request #9 ? Would you accept a different pull request that changed the python scripts in GDB instead, e.g. adding a parameter |
Sure would. Though I think moving the stats to the target might be a better idea in the long run. I won't get around to doing that soon though. |
Hi,
I've come back to this after working on some other stuff, and I have now ported a lot of my tests over to use metal.test, and I like how quick and easy it makes the edit/test cycle. However, is there any way to turn off printing every comparison made? If I am running a comparison in a loop, the screen rapidly fills with lines. I had a quick look in metal-unit.py, but couldn't see a parameter for this.
I suspect this also slows test execution down, as a breakpoint is hit every time a METAL_ASSERT macro is used? If the breakpoint could be disabled unless an error occured, I think this would speed things up.
The text was updated successfully, but these errors were encountered: