[Cmake-commits] CMake branch, next, updated. v3.0.0-rc3-2421-g252ccd1
Brad King
brad.king at kitware.com
Wed Apr 16 14:03:54 EDT 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 252ccd1edb1c8a0a2739f24c5ac28f4ae4daaa2d (commit)
via 1f3e95ba72cdafec0efb99d43a062b538780b093 (commit)
from 93ee0e08203c52ce83cefe73879bf59b62ba3c50 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=252ccd1edb1c8a0a2739f24c5ac28f4ae4daaa2d
commit 252ccd1edb1c8a0a2739f24c5ac28f4ae4daaa2d
Merge: 93ee0e0 1f3e95b
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Apr 16 14:03:53 2014 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Apr 16 14:03:53 2014 -0400
Merge topic 'FindGTest-typed-test' into next
1f3e95ba FindGTest: Teach GTEST_ADD_TESTS about TYPED_TEST
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f3e95ba72cdafec0efb99d43a062b538780b093
commit 1f3e95ba72cdafec0efb99d43a062b538780b093
Author: Jack Morrison <jackmorrison1 at gmail.com>
AuthorDate: Wed Apr 16 13:15:59 2014 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Apr 16 14:01:52 2014 -0400
FindGTest: Teach GTEST_ADD_TESTS about TYPED_TEST
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
index c4f911d..6a36ea6 100644
--- a/Modules/FindGTest.cmake
+++ b/Modules/FindGTest.cmake
@@ -116,19 +116,25 @@ function(GTEST_ADD_TESTS executable extra_args)
get_property(ARGN TARGET ${executable} PROPERTY SOURCES)
endif()
set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+), *([A-Za-z_0-9]+) *\\).*")
+ set(gtest_test_type_regex "(TYPED_TEST|TEST_?[FP]?)")
foreach(source ${ARGN})
file(READ "${source}" contents)
- string(REGEX MATCHALL "TEST_?[FP]?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
+ string(REGEX MATCHALL "${gtest_test_type_regex}\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
foreach(hit ${found_tests})
- string(REGEX MATCH "TEST_?[FP]?" test_type ${hit})
+ string(REGEX MATCH "${gtest_test_type_regex}" test_type ${hit})
- # Parameterized tests have a different signature for the filter
- if(${test_type} STREQUAL "TEST_P")
- string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" test_name ${hit})
- else()
- string(REGEX REPLACE ${gtest_case_name_regex} "\\1.\\2" test_name ${hit})
- endif()
- add_test(${test_name} ${executable} --gtest_filter=${test_name} ${extra_args})
+ # Parameterized tests have a different signature for the filter
+ if(${test_type} STREQUAL "TEST_P")
+ string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" test_name ${hit})
+ elseif(${test_type} STREQUAL "TEST_F" OR ${test_type} STREQUAL "TEST")
+ string(REGEX REPLACE ${gtest_case_name_regex} "\\1.\\2" test_name ${hit})
+ elseif(${test_type} STREQUAL "TYPED_TEST")
+ string(REGEX REPLACE ${gtest_case_name_regex} "\\1/*.\\2" test_name ${hit})
+ else()
+ message(WARNING "Could not parse GTest ${hit} for adding to CTest.")
+ continue()
+ endif()
+ add_test(${test_name} ${executable} --gtest_filter=${test_name} ${extra_args})
endforeach()
endforeach()
endfunction()
-----------------------------------------------------------------------
Summary of changes:
Modules/FindGTest.cmake | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list