summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/GoogleTestAddTests.cmake9
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt4
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt4
-rw-r--r--Tests/RunCMake/GoogleTest/fake_gtest.cpp1
4 files changed, 13 insertions, 5 deletions
diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake
index 7043b2b..a10b5d0 100644
--- a/Modules/GoogleTestAddTests.cmake
+++ b/Modules/GoogleTestAddTests.cmake
@@ -142,15 +142,14 @@ function(gtest_discover_tests_impl)
endif()
string(REGEX REPLACE "^DISABLED_" "" pretty_suite "${pretty_suite}")
else()
- # Test name; strip spaces and comments to get just the name...
- string(REGEX REPLACE " +" "" test "${line}")
+ string(STRIP "${line}" test)
if(test MATCHES "#" AND NOT _NO_PRETTY_VALUES)
- string(REGEX REPLACE "/[0-9]+#GetParam..=" "/" pretty_test "${test}")
+ string(REGEX REPLACE "/[0-9]+[ #]+GetParam\\(\\) = " "/" pretty_test "${test}")
else()
- string(REGEX REPLACE "#.*" "" pretty_test "${test}")
+ string(REGEX REPLACE " +#.*" "" pretty_test "${test}")
endif()
string(REGEX REPLACE "^DISABLED_" "" pretty_test "${pretty_test}")
- string(REGEX REPLACE "#.*" "" test "${test}")
+ string(REGEX REPLACE " +#.*" "" test "${test}")
if(NOT "${_TEST_XML_OUTPUT_DIR}" STREQUAL "")
set(TEST_XML_OUTPUT_PARAM "--gtest_output=xml:${_TEST_XML_OUTPUT_DIR}/${prefix}${suite}.${test}${suffix}.xml")
else()
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt
index 9c0b775..01b39c3 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt
@@ -49,6 +49,8 @@ Test project .*
*[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:param/special\.case/"__osbtext"!1 \.+ +Passed +[0-9.]+ sec
*Start +[0-9]+: TEST:param/special\.case/"__csb___text"!1
*[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:param/special\.case/"__csb___text"!1 \.+ +Passed +[0-9.]+ sec
+ *Start +[0-9]+: TEST:param/special\.case/"S o m e "!1
+ *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:param/special\.case/"S o m e "!1 \.+ +Passed +[0-9.]+ sec
*Start +[0-9]+: TEST:ns\.param/special\.case/"semicolon;"!1
*[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"semicolon;"!1 \.+ +Passed +[0-9.]+ sec
*Start +[0-9]+: TEST:ns\.param/special\.case/"backslash\\"!1
@@ -63,6 +65,8 @@ Test project .*
*[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"__osbtext"!1 \.+ +Passed +[0-9.]+ sec
*Start +[0-9]+: TEST:ns\.param/special\.case/"__csb___text"!1
*[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
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 b0210c6..796e20c 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt
@@ -49,6 +49,8 @@ Test project .*
*[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:param/special\.case/"__osbtext"!2 \.+ +Passed +[0-9.]+ sec
*Start +[0-9]+: TEST:param/special\.case/"__csb___text"!2
*[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:param/special\.case/"__csb___text"!2 \.+ +Passed +[0-9.]+ sec
+ *Start +[0-9]+: TEST:param/special\.case/"S o m e "!2
+ *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:param/special\.case/"S o m e "!2 \.+ +Passed +[0-9.]+ sec
*Start +[0-9]+: TEST:ns\.param/special\.case/"semicolon;"!2
*[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"semicolon;"!2 \.+ +Passed +[0-9.]+ sec
*Start +[0-9]+: TEST:ns\.param/special\.case/"backslash\\"!2
@@ -63,6 +65,8 @@ Test project .*
*[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"__osbtext"!2 \.+ +Passed +[0-9.]+ sec
*Start +[0-9]+: TEST:ns\.param/special\.case/"__csb___text"!2
*[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
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 aa6468c..183e106 100644
--- a/Tests/RunCMake/GoogleTest/fake_gtest.cpp
+++ b/Tests/RunCMake/GoogleTest/fake_gtest.cpp
@@ -61,6 +61,7 @@ int main(int argc, char** argv)
std::cout << " case/4 # GetParam() = \"]]=]\"" << std::endl;
std::cout << " case/5 # GetParam() = \"__osbtext\"" << std::endl;
std::cout << " case/6 # GetParam() = \"__csb___text\"" << std::endl;
+ std::cout << " case/7 # GetParam() = \"S o m e \"" << std::endl;
}
}
return 0;