Catch2: Suggestion: Report filter usage

Created on 24 Feb 2019  ·  8Comments  ·  Source: catchorg/Catch2

Description
When running the tests with any filters enabled, print the filter as part of the tests results.

Instead of this:
image

Have something like this:
image

Tweak request

All 8 comments

I like the idea.

@horenmar, if you want to give me some guiding points (since I never looked at the source code) maybe I can implement this and open a PR

Here are the basics:

  • Reporters are implemented in files in include/reporters/
  • There are two methods that can interest you from the reporter interface, testRunEnded and testRunStarted
  • Various reporters follow different convention and need different treatment.

    • I would probably skip CompactReporter

    • XMLReporter just needs a reasonable name for the tag

    • JunitReporter follows the JUnit standard (or at least our understanding of it). You would have to check if there is similar field in the JUnit XML standard, or at least a "comment" field or similar

    • ConsoleReporter looks good the way you proposed

    • TeamCity reporter uses the TeamCity format -- I am fairly sure that the format allows for arbitrary comments, but you'd have to check

    • AutoMake and TAP reporters: 🤷‍♂️

As for the testing and stuff, docs/contributing.md should be a reasonable overview.

This has been added to master.

@horenmar Just a idea, but should Filters: only be output when a filter is actually used?

After upgrading to 2.7.1 I was a little surprised to see yellow output at the top when I didn't set filters and all tests passed. I think it might be a nicer UX if Filters: is only printed if the filters are used.

Thoughts?

Its already fixed in master, but the release will have to wait until weekend.

@horenmar can you give a reference the commit that fixed this?

e99f1efd289944142

Was this page helpful?
0 / 5 - 0 ratings