google / googlemock

Google Mock
427 stars 204 forks source link

Allow to specify extra message for Matchers #186

Open sirzooro opened 9 years ago

sirzooro commented 9 years ago

Hi, It would be handy to specify extra message for matchers, e.g. via << operator or any other syntax. When multiple matchers are specified using AllOf, it becomes hard to determine what exactly failed. I had to debug test which tested multiple fields of structure passed to function, and message printed by gmock was not very clear. It would be much easier to debug if field name was printed.

You can also consider modifying Field matcher to automatically include field name passed as argument.