catchorg / Catch2

A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch)
https://discord.gg/4CWS9zD
Boost Software License 1.0
18.69k stars 3.05k forks source link

catch_discover_tests fails if test names contain an unterminated [ #2502

Open PeteAudinate opened 2 years ago

PeteAudinate commented 2 years ago

Describe the bug For a file with two tests: "Test1[" and "Test2", catch_discover_tests produces the following:

$ ctest
Test project /home/username/test_ctest/build
    Start 1: Test1[;Test2;
1/1 Test #1: Test1[;Test2; ....................   Passed    0.00 sec

Expected behavior If "Test1[" is renamed to "Test1", it works correctly:

$ ctest
Test project /home/username/test_ctest/build
    Start 1: Test1
1/2 Test #1: Test1 ............................   Passed    0.00 sec
    Start 2: Test2
2/2 Test #2: Test2 ............................   Passed    0.00 sec

Reproduction steps

Minimal test to reproduce: test_ctest.zip

Platform information:

Additional context

PeteAudinate commented 2 years ago

From https://cmake.org/cmake/help/v3.0/manual/cmake-language.7.html#lists:

a string is divided into list elements by splitting on ; characters not following an unequal number of [ and ] characters