Display an optional message on test failure

Here is a PR on adding an optional message to display on test failure. All the project's tests continue to pass after this change.

Let me know if there's anything additional required (documentation, tests) before this can be merged.