-
-
Notifications
You must be signed in to change notification settings - Fork 641
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
Automatically add TEST_SUITE labels to discovered tests #464
Conversation
Hi, In a world where we had native XML parsing support in CMake it would have been better to switch to parsing the XML output in My concern with the current approach is that if there are thousands of test cases there would be thousands of invocations of the binary just to discover the test suite of the test cases. Perhaps this labeling shouldn't be on by default and should be guarded in an I'll leave this PR open for now (hopefully will get more feedback from others as I'm not a user of these CMake scripts) but you should be free to use these changes locally for now. |
Sorry for the delay I had some deadlines. I also was worried about this. In my use case there are only a few (<100) tests so there is no perceptible overhead, but this clearly could vary. I hope this method can serve as a stand in until there is a cleaner XML based method. I wrapped this in an
I'm fine with leaving this open for as long as you'd like. I am working from the branch for the time being so it doesn't hold me up! |
thanks for the contribution! |
…the test suites of the test cases (#464)
Seeing a failure in test discovery when upgrading to 2.4.6 due to this feature when labels are not explicitly set. Example:
This is the error: CMake Error at .../scripts/cmake/doctestAddTests.cmake:60 (if):
if given arguments:
"EQUAL" "1"
Unknown arguments specified To workaround, need to explicitly set
Please take care of the scenario where |
Hi Thanks for reporting this I opened #489. I'll update there once the issue is fixed. |
#490 fixes this. |
doctest/doctest#464 の問題でdoctest_discover_tests()が壊れているので、その直前の2.4.5にまで更新
The PR is against dev, and I have read the
CONTRIBUTING.md
. I understand that usually a issue is opened for discussion, but I figured the draft PR would illustrate the changes better.Description
What:
When using
doctest_discover_tests
, theLABELS
property is set for the generated test based on theTEST_SUITE
.Why:
In a downstream project using CMake, I found it useful to group each
TEST_CASE
in aTEST_SUITE
. I found myself wanting to selectively run tests based on whatTEST_SUITE
they belong to, e.g,ctest -L TEST_SUITE_NAME
. The test discovery returns the list of test, but modifying each one would be tedious.GitHub Issues
#302 is related, but the discussion doesn't seem to indicate that this is the desired solution.