-
Notifications
You must be signed in to change notification settings - Fork 3k
Add newline after mbed error so greentea shows it #10964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When the function `error` is called without ending in a newline greentea will not display the error. This is because greentea is performing line buffering. This patch ensures that all calls to `error` end with a newline. This is done by adding an additional newline to end end of the string. Example code exhibiting this problem: error("This function is not supported."); Greentea output before this change: ++ MbedOS Error Info ++ Error Status: 0x80FF0100 Code: 256 Module: 255 Error Message: Fatal Run-time error Location: 0x1001766D Error Value: 0x0 Current Thread: main Id: 0x8003FD8 Entry: 0x1000E64F StackSize: 0x1000 StackMem: 0x8004AE8 SP: 0x8005898 For more info, visit: https://mbed.com/s/error?error=0x80FF0100&tgt=target -- MbedOS Error Info -- test suite run finished after 240.50 sec... Greentea output after this change: ++ MbedOS Error Info ++ Error Status: 0x80FF0100 Code: 256 Module: 255 Error Message: Fatal Run-time error Location: 0x1001766D Error Value: 0x0 Current Thread: main Id: 0x8003FD8 Entry: 0x1000E64F StackSize: 0x1000 StackMem: 0x8004AE8 SP: 0x8005898 For more info, visit: https://mbed.com/s/error?error=0x80FF0100&tgt=target -- MbedOS Error Info -- This function is not supported. test suite run finished after 240.50 sec...
@c1728p9, thank you for your changes. |
@kjbracey-arm We had discussions around newlines. I recall some patches adding newline in strings by themselves. This patch is important to have for the next week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought we'd ensured a newline somewhere else recently for the same reason, but I guess it wasn't on this path.
Is this fixing #10626 ? |
CI started (expected cloud client test to fail, we are investigating this) |
Ew, no. ROM space! Some APIs are inherently "single-line per call" (for potential packetisation purposes) like
Callers should only have to put their own newlines in when it's a free-form API that can actually print part of a line at a time, like
So it is. That's what I was recalling. So we just talked about it, didn't do it... |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Hi @jeromecoutant this fixes #10626. Thanks for pointing this out. I didn't realize there was an open issue when I created the PR. |
Description
When the function
error
is called without ending in a newline greentea will not display the error. This is because greentea is performing line buffering.This patch ensures that all calls to
error
end with a newline. This is done by adding an additional newline to end end of the string.Example code exhibiting this problem:
Greentea output before this change:
Greentea output after this change:
Pull request type