Skip to content
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

Use of INFO #415

Closed
mintyc opened this issue May 13, 2015 · 3 comments
Closed

Use of INFO #415

mintyc opened this issue May 13, 2015 · 3 comments

Comments

@mintyc
Copy link

mintyc commented May 13, 2015

IMO INFO currently is limited because it is scoped. It can only be used in the TEST_CASE body itself, not in mocks etc.

I would like to be able to log supplementary information that via the command line I can force to be output irrespective of whether an assertion fails.

Say I have some mock classes that I use in tests, I'd like them to be able to output INFO but they are scoped such that the INFO will never get out.
e.g. I have mocks of element types, Copyable, Movable etc and as well as asserting on numbers of constructions, move assignments etc in the test case itself, I sometimes want individual calls into the various methods to log a copy construction etc.

The existing behaviour of WARN can do this, but tags messages with 'warning' and is always on.

I'd propose existing INFO is renamed SCOPED to convey its restricted (but useful) purpose and INFO is repurposed to become more like WARN with the exception that it is only logged when explicitly requested on the command line.

@philsquared
Copy link
Collaborator

Hi @mintyc. Sorry it's been a long time getting this (I'm just seeing it for the first time during an old tickets review).
Is this still something that's relevant to you?

Ironically what you proposed used to be the case: INFO worked unscoped, and there was a separate SCOPED_INFO that had the behaviour that INFO now does. But I kept getting reports from people who found the behaviour of INFO surprising so eventually changed it to the scoped behaviour.
So perhaps the solution would be a separate macro for the unscoped case? UNSCOPED_INFO doesn't sound like a great name, but you get the idea?

Anyway I'm going to put this back on the queue as a feature request.

@mintyc
Copy link
Author

mintyc commented Mar 11, 2017

Sounds good 👍

@horenmar
Copy link
Member

horenmar commented Mar 6, 2019

UNSCOPED_INFO is a thing now.

@horenmar horenmar closed this as completed Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants