Make reporter lookup case insensitive, registration case preserving

Previously registration was case preserving, but lookup used
lowercased reporter name, so a reporter whose name contained
upper case character could not be requested by the user.
This commit is contained in:
Martin Hořeňovský
2021-11-07 23:31:44 +01:00
parent 7800fe9708
commit 8780425385
6 changed files with 84 additions and 4 deletions

View File

@@ -197,6 +197,28 @@ add_test(
)
add_executable(CasingInReporterNames ${TESTS_DIR}/X23-CasingInReporterNames.cpp)
target_link_libraries(CasingInReporterNames PRIVATE Catch2::Catch2WithMain)
add_test(
NAME Reporters::registration-is-case-preserving
COMMAND CasingInReporterNames --list-reporters
)
set_tests_properties(
Reporters::registration-is-case-preserving
PROPERTIES
PASS_REGULAR_EXPRESSION "testReporterCASED"
)
add_test(
NAME Reporters::selection-is-case-insensitive
COMMAND CasingInReporterNames -r testReportercased
)
set_tests_properties(
Reporters::selection-is-case-insensitive
PROPERTIES
PASS_REGULAR_EXPRESSION "TestReporter constructed"
)
add_executable(DuplicatedTestCases-SameNameAndTags ${TESTS_DIR}/X31-DuplicatedTestCases.cpp)
target_link_libraries(DuplicatedTestCases-SameNameAndTags PRIVATE Catch2::Catch2WithMain)
add_test(