-
-
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
WIP: Fix handling of semicolon and backslash characters in CMake test discovery #2676
Conversation
Codecov Report
@@ Coverage Diff @@
## devel #2676 +/- ##
==========================================
+ Coverage 91.19% 91.24% +0.05%
==========================================
Files 192 192
Lines 7843 7808 -35
==========================================
- Hits 7152 7124 -28
+ Misses 691 684 -7 |
Yeah, so far these CMake scripts are untested, because it was always more work than someone was willing to do to get them tested. Especially if the various options are to be covered as well. Even limiting ourselves to just the test parsing will be kinda annoying. One of the issues is that it will need to be checked in a separately compiled CMake project (to avoid the new tests spamming the current CTest tests), and the check will have to be done by a separate (Python) script. We should check that the various problematic test names are both registered & invoked properly -- first thing I can think of is to have each |
Hmm... Is that really necessary? As I've mentioned in the issue, there were a lot of false positives (failing test cases) before I fixed the bug. |
Technically no, but that is where my testing paranoia has gotten to over time 😃 See e.g. the various reporter tests that fail if the test-specific reporter does not report as used, so that there is a loud error if the test reporter is not selected for whatever reason. One example:
My issue with plain This issue can be solved by counting the passed tests and checking that number against an expected number of tests. Can this fail? Yes, if the script breaks in a way that causes test spec to match multiple tests, e.g. bad escaping for ... I am honestly willing to merge the changes as they are right now, so I will obviously also merge the PR if it contains a weaker level of checking than I would like, but I would prefer more strict checks, unless they eventually prove to be too annoying to be maintained. |
Maybe we can split the work? |
Sorry for taking so long, but I finally had enough time to work on this. There is now a test scaffolding for the |
Description
This PR fixes the handling of semicolon and backslash characters in test names in the CMake test discovery
GitHub Issues
#2674
TODO:
How can we test this? I believe introducing a new "category" of tests that actually makes use of
catch_discover_tests
would be the best way?