-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve reporting of unmatched filters #1684
Conversation
This bug/feature request was reported in issue catchorg#1449. The new behaviour is to collect a list of matches per filter, and call the reporter's noMatchingTestCases if a filter has zero matches. Also, a non-zero exit code (2) is now returned if the option "-w NoTests" is active.
It has been renamed from TestSet to be more similar to the naming used by the Context class.
Codecov Report
@@ Coverage Diff @@
## master #1684 +/- ##
==========================================
+ Coverage 86.18% 86.44% +0.26%
==========================================
Files 136 136
Lines 5180 5266 +86
==========================================
+ Hits 4464 4552 +88
+ Misses 716 714 -2 |
The remaining failure is with the AppVeyor coverage build and is caused by OpenCppCoverage marking the exit code as an error where CTest does not (because it has |
I'll investigate the problem -- it is my understanding that both OpenCppCoverage and the wrapper we use for CTest should just pass-through the return codes back to CTest, so it should not fail. |
After closer look, the helper executable does not actually pass the return code up the stack... I'll try to fix it tomorrow. |
In the meantime I've downloaded this coverage tool and played with it, and I could also obtain a coverage report for all tests by running |
Hmmm, I'll take a look -- it has honestly never occurred to me to run coverage over the top level ctest process and let it take coverage from the children processes... |
I found it via this issue while googling about OpenCppCoverage. Oddly enough its documentation does not mention CMake or CTest at all, only the export + merge method that is currently used by Catch2. |
Good news: I fixed the helper to pass through return codes, and will merge it in the evening. Bad news: I also found out that the coverage merging fails in a way I am unable to reproduce locally, and will have to poke the CI to fix (second one this week, ugh) What this means is that you should rebase the PR tomorrow/late evening today and I'll start reviewing the changes. I'll also open up an issue to investigate the different method of gathering coverage. |
This allows #1684 to proceed forward.
Co-Authored-By: Martin Hořeňovský <martin.horenovsky@gmail.com>
You will probably need to pass through the path to the test binary from the main script. |
I think you were right, here's to hoping this is the final change! |
There is 1 more thing that needs fixing and one that I am not quite sure about. Needs fixing: the filter string in
The part I am not sure about is whether the extended reporting should be provided even if the |
This was slightly trickier as I've now had to mess with the test spec parser, but it does the trick and passes the tests on my machine. About the reporting, I would prefer to always leave at least a textual trace, so the user can see where they mistyped or misconfigured test cases. |
Okay, this looks good now. Would you prefer if I squash-merge it, or if you rebase and cleanup the branch? |
I'm fine with squashing, it is just improvements/fixes and regression tests that don't warrant multiple commits IMO. Thanks for the careful review! |
Description
This PR is for two issues related to filtering tests, reported in issue #1449.
It modifies various existing structures to allow checking whether any filters passed to a test executable did not result in any matching test cases, giving the user better feedback about the input. It also adds small helper classes to aid readability of the code. Additionally, the option
-w NoTests
is now correctly checked and an exit code 2 returned if there were any unmatched filters.GitHub Issues
Fixes #1449. Also fixes #1683.