Closed lalten closed 3 years ago
Thank you for reporting this. Especially for making me aware of the CATCH_CONFIG_CONSOLE_WIDTH
option. Another workaround that you can use is to use the custom discovery option explained on the Testcase Discovery page.
Regardless I will update the appropriate code and improve the given warning for the next release.
Hi, do you have a new release date for this fix? The Catch2 integration simply does not work.
I have a very small project with only 15 Test Cases, all have short names. GCC: 7.5.0, CMake: 3.10.2, Catch2: 2.13.4 (header only package)
Here is the list of tests:
$ ./testDisplayInterface --list-tests
All available test cases:
Display
DisplayInterfaceService
GraphicGenerator
GraphicStack
PatternE
PatternF
PatternNothing
PatternP
PatternT
PatternText
PatternTextTT
PciConnection
RehostInterface
Screen
Utilities
15 test cases
Yet the plugin gives me the following error:
⚠️ Probably too long test name or the test name starts with space characters! 🛠 - Try to define: #define CATCH_CONFIG_CONSOLE_WIDTH 300) 🛠 - Remove whitespace characters from the beggining of test " (NO DESCRIPTION)"
I have tried the #define CATCH_CONFIG_CONSOLE_WIDTH 300, it does not work and none of my test names have leading spaces.
Finally released a new version (1.6.0) that contains improvements in the area of dealing with long filenames (and long testcase names). There are still corner cases that won't work, but I don't see further room for improvement there. So I'm closing the issue.
The attached workspace (problem.zip) shows this problem.
All cpp files contain the same code, but while
123456789012345.cpp
,12345678901234567.cpp
,12345678901234567890.cpp
, andaname_1.0_good.cpp
work,aname_1.0_maybeatoolongname.cpp
, andloremipsumdolorsitametconsecetur.cpp
will fail with Test Explorer outputThe test will still work when invoked via GDB launch or when executed from command line.
Adding the line
#define CATCH_CONFIG_CONSOLE_WIDTH 300
tocatch2.cpp
did resolve this.It took me really long to figure out that the file name length is the issue here, not the length of the test name.
Maybe you could update the warning to say "Probably too long test name test name or file name, or the test name starts with space characters".