-
-
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
How to specify configuration in catch_discover_tests #1595
Comments
I'm not sure how helpful it is but looking at
versus
It might be that the test name you provide is not proper for this command. This property of |
I've been trying to get Catch2 (specifically My question is, is there really no way to work around this issue using CMake? I've tried modifying the name of the If the only way to resolve this issue is to modify Catch2, I think this means |
I stumbled upon the same thing. I was hoping, to be able to squeeze the config parameter in somewhere... But seemingly this is not possible, given @qak s comment. |
@AndreGosselink Can you explain why you struck out the config name pre/postfix idea? What’s the problem with it? I was thinking along the same lines for a fix:
|
@be-sc My impression is that you've suggested a solution to the problem that involves altering the internals of Catch2, whereas it appears @AndreGosselink was attempting to work around the problem by passing appropriate arguments to |
I just realized multi-config support for PRE_TEST is already present on the devel branch (#2739). It works great for Ninja Multi-Config. |
It looks like support for multi-config CMake generators has been added to Catch2 version 3.5.0, according to the changelog. It'll take me a while to test this out (maybe up to several weeks), so if somebody gets to try out the new functionality, please don't hesitate to follow up in this thread. |
I can't remember exactly what I was trying, but I somewhat wanted to hand down a configuration value to ctests
Will try it, cheers |
As I understand it, this should be solved. Both XCode and MSVC projects can now use discover_tests, which are both multi-config build systems. |
I've tested using |
(I noticed this issue when I saw that the CI for one of my projects, which builds first the In case it's technically feasible to fix the behavior of CMake multi-config generators with Catch2's default |
So, using
contrib/Catch.cmake
we havecatch_discover_tests()
which is nice. However, for Windows users with multiple configurations it would be nice to be able to register tests in ctest using the appropriate CONFIGURATIONS for each test.I tried to fiddle a bit with the
contrib/CatchAddTests.cmake
but I couldn't figure out how to make it work (it keeps naming all my testsNAME
if I try to use the first signature ofadd_test(NAME ...)
in the ctest script).Anyone has suggestion on how to achieve this?
The text was updated successfully, but these errors were encountered: