-
Notifications
You must be signed in to change notification settings - Fork 609
Include stacktrace when no matching expected call #65
Conversation
This may be obsolete, now that #97 has been merged. It depends whether a full stack trace is considered preferable. Feel free to close this if not. |
I do think a stack trace could be useful but I want to make sure that the output is more helpful than confusing. I need some sample outputs for that but haven't gotten around to making some on my own. If you want to produce those for me then we could get there faster :) |
This helps with tracking down the offending call.
This helps with tracking down the offending expectation.
I've just modified the NotMatcher test to fail in order to get sample output. No matching expected call:
Invalid call expectation:
The call stack does end up containing a few calls internal to gomock before it gets to the user's test code, but I don't think that's too confusing. With some extra code, it should be possible to strip some of these internal calls (the top two at least), but I'm not sure if that would be more or less confusing. |
See #171. I did a bit of filtering of the stack so it starts with the code that made the call (not gomock) and it goes up the stack until it hits a filename with Sample output:
|
@RJPercival Thanks for the PR. This no longer merges and has been open for a while. I'm going to close it, but feel free to reopen it. |
This helps with tracking down the offending call.