Make mock generation rule match testing rule.
Make mock generation rule match testing rule.

Reuse the same single-line pattern for both mock file generation as well
as testing so that it's visually obvious that they are doing the same
thing.

Using the approach with `define` / `endef` as per this doc:
https://www.gnu.org/software/make/manual/html_node/Canned-Recipes.html
did not seem to work on macOS, so we have to accept duplication.

google/code-review-bot,google/code-review-bot