[Cmake-commits] [cmake-commits] lowman committed FindGTest.cmake 1.3 1.4

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Jan 5 00:15:00 EST 2010


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv13006

Modified Files:
	FindGTest.cmake 
Log Message:
Fix issue #10065, "FindGTest.cmake doesn't handle spaces around arguments to TEST/TEST_F macro".

Also improved the documentation.


Index: FindGTest.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindGTest.cmake,v
retrieving revision 1.3
retrieving revision 1.4
diff -C 2 -d -r1.3 -r1.4
*** FindGTest.cmake	1 Oct 2009 05:12:40 -0000	1.3
--- FindGTest.cmake	5 Jan 2010 05:14:58 -0000	1.4
***************
*** 16,29 ****
  # Accepts the following variables as input:
  #
! #   GTEST_ROOT - (as CMake or env. variable)
  #                The root directory of the gtest install prefix
  #
! #   GTEST_MSVC_SEARCH - If on MSVC, enables searching the build tree of
! #                       GTest if set to MD or MT (defaults: MD)
  #
  #-----------------------
  # Example Usage:
  #
! #    enable_testing(true)
  #    find_package(GTest REQUIRED)
  #    include_directories(${GTEST_INCLUDE_DIRS})
--- 16,30 ----
  # Accepts the following variables as input:
  #
! #   GTEST_ROOT - (as a CMake or environment variable)
  #                The root directory of the gtest install prefix
  #
! #   GTEST_MSVC_SEARCH - If compiling with MSVC, this variable can be set to
! #                       "MD" or "MT" to enable searching a GTest build tree
! #                       (defaults: "MD")
  #
  #-----------------------
  # Example Usage:
  #
! #    enable_testing()
  #    find_package(GTest REQUIRED)
  #    include_directories(${GTEST_INCLUDE_DIRS})
***************
*** 37,42 ****
  #
  # If you would like each Google test to show up in CTest as
! # a test you may use the following macro.  NOTE: It WILL slow
! # down your tests, so be warned.
  #
  # GTEST_ADD_TESTS(executable extra_args ARGN)
--- 38,45 ----
  #
  # If you would like each Google test to show up in CTest as
! # a test you may use the following macro.
! # NOTE: It will slow down your tests by running an executable
! # for each test and test fixture.  You will also have to rerun
! # CMake after adding or removing tests or test fixtures.
  #
  # GTEST_ADD_TESTS(executable extra_args ARGN)
***************
*** 77,81 ****
          string(REGEX MATCHALL "TEST_?F?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
          foreach(hit ${found_tests})
!             string(REGEX REPLACE ".*\\(([A-Za-z_0-9]+)[, ]*([A-Za-z_0-9]+)\\).*" "\\1.\\2" test_name ${hit})
              add_test(${test_name} ${executable} --gtest_filter=${test_name} ${extra_args})
          endforeach()
--- 80,84 ----
          string(REGEX MATCHALL "TEST_?F?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
          foreach(hit ${found_tests})
!             string(REGEX REPLACE ".*\\( *([A-Za-z_0-9]+), *([A-Za-z_0-9]+) *\\).*" "\\1.\\2" test_name ${hit})
              add_test(${test_name} ${executable} --gtest_filter=${test_name} ${extra_args})
          endforeach()



More information about the Cmake-commits mailing list