Empty tag in test case produces crash when generating junit report
Describe the bug
If I write a test case like so:
TEST_CASE("Test requirements of some type", "[][type]") {...}
where we have an empty tag "[]", the program crashes when we try to generate junit output. Normal xml output works apparently.
Expected behavior I would expect no crash and that the empty tag is in the output like it is for the normal xml.
Reproduction steps
Build your test executable in debug mode and run
Test.exe -r junit
This should trigger an assertion in std::string about calling front() on an empty string.
Platform information:
- OS: windows 10
- Compiler+version: Microsoft (R) C/C++ Optimizing Compiler Version 19.30.30709 for x64
- Catch version: v2.13.8
I am not convinced that empty tags are useful, but they shouldn't cause crashes (I think they should be rejected).
I can't reproduce this with current devel branch.
TEST_CASE( "Empty tag", "[][type]" ) { REQUIRE( true ); }
$ ./tests/SelfTest
Errors occurred during startup!
Empty tags are not allowed
However I am unhappy about the behaviour of ./tests/SelfTest [] if I delete the test, as it runs all the tests -- I believe it should be a cli input error and not match every test.
You are right that it is of no use. I would be happy that it was rejected as invalid.