diff options
author | Brad King <brad.king@kitware.com> | 2023-03-03 17:57:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-03 17:57:59 (GMT) |
commit | 3abd37f05d4686f13fee592dc58aeef506e6f121 (patch) | |
tree | 85541af2f5aa04460a37815a4778deb62a3778e7 | |
parent | 878e8d2f4a8ca5d743e199d20cc0bc2601730643 (diff) | |
parent | 9aa9032266b0c4cd8219d637a97b527dc86e2f85 (diff) | |
download | CMake-3abd37f05d4686f13fee592dc58aeef506e6f121.zip CMake-3abd37f05d4686f13fee592dc58aeef506e6f121.tar.gz CMake-3abd37f05d4686f13fee592dc58aeef506e6f121.tar.bz2 |
Merge branch 'GoogleTest-type-param-suite' into release-3.23
Merge-request: !8282
6 files changed, 68 insertions, 4 deletions
diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake index 2bd0cc9..de0f7d6 100644 --- a/Modules/GoogleTestAddTests.cmake +++ b/Modules/GoogleTestAddTests.cmake @@ -134,7 +134,7 @@ function(gtest_discover_tests_impl) # Module; remove trailing '.' to get just the name... string(REGEX REPLACE "\\.( *#.*)?$" "" suite "${line}") if(line MATCHES "#") - string(REGEX REPLACE "/.*" "" pretty_suite "${line}") + string(REGEX REPLACE "/[0-9].*" "" pretty_suite "${line}") if(NOT _NO_PRETTY_TYPES) string(REGEX REPLACE ".*/[0-9]+[ .#]+TypeParam = (.*)" "\\1" type_parameter "${line}") else() diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-arg-change-typed-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-arg-change-typed-stdout.txt index c4545ca..d4b4fcf 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-arg-change-typed-stdout.txt +++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-arg-change-typed-stdout.txt @@ -5,5 +5,8 @@ Test project .*/Tests/RunCMake/GoogleTest/GoogleTest-discovery-arg-change Test #[0-9]+: ns\.typed\.case<short> Test #[0-9]+: ns\.typed\.case<float> Test #[0-9]+: ns\.typed\.case<char> + Test #[0-9]+: prefix/typed\.case<short> + Test #[0-9]+: prefix/typed\.case<float> + Test #[0-9]+: prefix/typed\.case<char> Total Tests: [0-9]+ diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt index c462042..4fa2b5c 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt +++ b/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt @@ -31,6 +31,12 @@ Test project .* *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.typed\.case<float>!1 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:ns\.typed\.case<char>!1 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.typed\.case<char>!1 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/typed\.case<short>!1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/typed\.case<short>!1 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/typed\.case<float>!1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/typed\.case<float>!1 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/typed\.case<char>!1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/typed\.case<char>!1 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:value/test\.case/1!1 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:value/test\.case/1!1 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:value/test\.case/"foo"!1 @@ -39,6 +45,10 @@ Test project .* *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.value/test\.case/1!1 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:ns\.value/test\.case/"foo"!1 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.value/test\.case/"foo"!1 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/value/test\.case/1!1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/value/test\.case/1!1 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/value/test\.case/"foo"!1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/value/test\.case/"foo"!1 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:param/special\.case/"semicolon;"!1 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:param/special\.case/"semicolon;"!1 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:param/special\.case/"backslash\\"!1 @@ -71,6 +81,22 @@ Test project .* *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"__csb___text"!1 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:ns\.param/special\.case/"S o m e "!1 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"S o m e "!1 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/"semicolon;"!1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/"semicolon;"!1 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/"backslash\\"!1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/"backslash\\"!1 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/"\${var}"!1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/"\${var}"!1 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/'\['!1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/'\['!1 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/"\]\]=\]"!1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/"\]\]=\]"!1 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/"__osbtext"!1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/"__osbtext"!1 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/"__csb___text"!1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/"__csb___text"!1 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/"S o m e "!1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/"S o m e "!1 \.+ +Passed +[0-9.]+ sec 100% tests passed, 0 tests failed out of [0-9]+ diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt index 8cdd1a0..99b641b 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt +++ b/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt @@ -31,6 +31,12 @@ Test project .* *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.typed\.case<float>!2 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:ns\.typed\.case<char>!2 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.typed\.case<char>!2 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/typed\.case<short>!2 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/typed\.case<short>!2 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/typed\.case<float>!2 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/typed\.case<float>!2 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/typed\.case<char>!2 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/typed\.case<char>!2 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:value/test\.case/1!2 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:value/test\.case/1!2 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:value/test\.case/"foo"!2 @@ -39,6 +45,10 @@ Test project .* *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.value/test\.case/1!2 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:ns\.value/test\.case/"foo"!2 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.value/test\.case/"foo"!2 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/value/test\.case/1!2 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/value/test\.case/1!2 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/value/test\.case/"foo"!2 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/value/test\.case/"foo"!2 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:param/special\.case/"semicolon;"!2 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:param/special\.case/"semicolon;"!2 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:param/special\.case/"backslash\\"!2 @@ -71,6 +81,22 @@ Test project .* *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"__csb___text"!2 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:ns\.param/special\.case/"S o m e "!2 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"S o m e "!2 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/"semicolon;"!2 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/"semicolon;"!2 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/"backslash\\"!2 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/"backslash\\"!2 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/"\${var}"!2 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/"\${var}"!2 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/'\['!2 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/'\['!2 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/"\]\]=\]"!2 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/"\]\]=\]"!2 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/"__osbtext"!2 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/"__osbtext"!2 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/"__csb___text"!2 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/"__csb___text"!2 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/param/special\.case/"S o m e "!2 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/param/special\.case/"S o m e "!2 \.+ +Passed +[0-9.]+ sec 100% tests passed, 0 tests failed out of [0-9]+ diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-test4-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-test4-stdout.txt index b0f70e7..d9203bc 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTest-test4-stdout.txt +++ b/Tests/RunCMake/GoogleTest/GoogleTest-test4-stdout.txt @@ -11,6 +11,12 @@ Test project .* *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.typed\.case<float>!4 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:ns\.typed\.case<char>!4 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.typed\.case<char>!4 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/typed\.case<short>!4 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/typed\.case<short>!4 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/typed\.case<float>!4 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/typed\.case<float>!4 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:prefix/typed\.case<char>!4 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:prefix/typed\.case<char>!4 \.+ +Passed +[0-9.]+ sec 100% tests passed, 0 tests failed out of [0-9]+ diff --git a/Tests/RunCMake/GoogleTest/fake_gtest.cpp b/Tests/RunCMake/GoogleTest/fake_gtest.cpp index e6f74aa..9236bd1 100644 --- a/Tests/RunCMake/GoogleTest/fake_gtest.cpp +++ b/Tests/RunCMake/GoogleTest/fake_gtest.cpp @@ -34,7 +34,8 @@ int main(int argc, char** argv) std::cout << " case" << std::endl; } if (!is_basic_only) { - const char* typed_suite_names[] = { "typed", "ns.typed" }; + const char* typed_suite_names[] = { "typed", "ns.typed", + "prefix/typed" }; for (size_t i = 0; i < ARRAY_SIZE(typed_suite_names); i++) { std::cout << typed_suite_names[i] << "/0. # TypeParam = short\n"; std::cout << " case" << std::endl; @@ -45,13 +46,15 @@ int main(int argc, char** argv) } } if (!is_basic_only && !is_typed_only) { - const char* value_suite_names[] = { "value", "ns.value" }; + const char* value_suite_names[] = { "value", "ns.value", + "prefix/value" }; for (size_t i = 0; i < ARRAY_SIZE(value_suite_names); i++) { std::cout << value_suite_names[i] << "/test." << std::endl; std::cout << " case/0 # GetParam() = 1" << std::endl; std::cout << " case/1 # GetParam() = \"foo\"" << std::endl; } - const char* param_suite_names[] = { "param", "ns.param" }; + const char* param_suite_names[] = { "param", "ns.param", + "prefix/param" }; for (size_t j = 0; j < ARRAY_SIZE(param_suite_names); j++) { std::cout << param_suite_names[j] << "/special." << std::endl; std::cout << " case/0 # GetParam() = \"semicolon;\"" << std::endl; |