I want to change gmock warnings into errors in all uninteresting gmock function calls. I search some and I found that i should use --gmock_verbose=LEVEL flag but where should I add this flag? Unfortunately I couldn't change all NiceMocks to StrictMocks.
Asked
Active
Viewed 1,227 times
0
-
this flag doesn't solve my issue, it just hide warnings. Is in Gmock any possibility to change warnings to errors without change NiceMock to StrictMock ? – Patryk Kaczmarek Sep 27 '17 at 10:11
-
That would be fundamental maintenance problem in your project if `NiceMock` start generating errors because of that - it is 100% against their design purposes. It is like requiring from good people to do bad things but - "please do not call them evil people"... Just use `StrictMock` - or create type-alias `ConfigurableMock` and once make it NiceMock, once StrictMock... – PiotrNycz Sep 28 '17 at 09:05
1 Answers
0
where should I add this flag?
You can add gmock flags like --gmock_verbose=error
directly in the command line.
Otherwise, you can always specify verbosity on a per test basis by putting ::testing::FLAGS_gmock_verbose = "error";
in the test code itself.

Scott Madeux
- 329
- 3
- 8