[Cmake-commits] [cmake-commits] lowman committed FindCxxTest.cmake 1.1 1.2
cmake-commits at cmake.org
cmake-commits at cmake.org
Thu Jan 8 04:47:43 EST 2009
Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv29223
Modified Files:
FindCxxTest.cmake
Log Message:
BUG: Fixed CXXTEST_INCLUDE_DIRS so it will work properly with NOTFOUND.
Also eliminated superfluous CXXTEST_FOUND assignment and cleaned up the code
and added additional documentation. Tagged v1.0.
Index: FindCxxTest.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindCxxTest.cmake,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** FindCxxTest.cmake 12 Dec 2008 03:05:30 -0000 1.1
--- FindCxxTest.cmake 8 Jan 2009 09:47:40 -0000 1.2
***************
*** 1,6 ****
# - Find CxxTest
# Find the CxxTest suite and declare a helper macro for creating unit tests
! # and integrating them with CTest. To assist in finding CxxTest the
! # CMAKE_PREFIX_PATH variable can be used.
# For more details on CxxTest see http://cxxtest.tigris.org
#
--- 1,5 ----
# - Find CxxTest
# Find the CxxTest suite and declare a helper macro for creating unit tests
! # and integrating them with CTest.
# For more details on CxxTest see http://cxxtest.tigris.org
#
***************
*** 8,20 ****
#
# CXXTEST_USE_PYTHON
! # If true, have the CXXTEST_ADD_TEST macro use
! # the python test generator instead of perl.
#
# OUTPUT Variables
#
- # CXXTEST_INCLUDE_DIR
- # Where to find the CxxTest include directory
# CXXTEST_FOUND
# True if the CxxTest framework was found
# CXXTEST_PERL_TESTGEN_EXECUTABLE
# The perl-based test generator.
--- 7,19 ----
#
# CXXTEST_USE_PYTHON
! # If true, the CXXTEST_ADD_TEST macro will use
! # the Python test generator instead of Perl.
#
# OUTPUT Variables
#
# CXXTEST_FOUND
# True if the CxxTest framework was found
+ # CXXTEST_INCLUDE_DIR
+ # Where to find the CxxTest include directory
# CXXTEST_PERL_TESTGEN_EXECUTABLE
# The perl-based test generator.
***************
*** 32,36 ****
# CxxTest::TestSuite's to be included in this runner
#
! # Example:
# ENABLE_TESTING()
# CXXTEST_ADD_TEST(unittest_foo foo_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h)
--- 31,40 ----
# CxxTest::TestSuite's to be included in this runner
#
! # #==============
! # Example Usage:
! #
! # FIND_PACKAGE(CxxTest)
! # INCLUDE_DIRECTORIES(${CXXTEST_INCLUDE_DIR})
! #
# ENABLE_TESTING()
# CXXTEST_ADD_TEST(unittest_foo foo_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h)
***************
*** 41,52 ****
# 2. Create an executable and test called unittest_foo.
#
MACRO(CXXTEST_ADD_TEST _cxxtest_testname _cxxtest_outfname)
SET(_cxxtest_real_outfname ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_outfname})
IF(CXXTEST_USE_PYTHON)
SET(_cxxtest_executable ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE})
! ELSE(CXXTEST_USE_PYTHON)
SET(_cxxtest_executable ${CXXTEST_PERL_TESTGEN_EXECUTABLE})
! ENDIF(CXXTEST_USE_PYTHON)
ADD_CUSTOM_COMMAND(
--- 45,83 ----
# 2. Create an executable and test called unittest_foo.
#
+ # #=============
+ # Example foo_test.h:
+ #
+ # #include <cxxtest/TestSuite.h>
+ #
+ # class MyTestSuite : public CxxTest::TestSuite
+ # {
+ # public:
+ # void testAddition( void )
+ # {
+ # TS_ASSERT( 1 + 1 > 1 );
+ # TS_ASSERT_EQUALS( 1 + 1, 2 );
+ # }
+ # };
+ #
+ #
+ # FindCxxTest.cmake
+ # Copyright (c) 2008
+ # Philip Lowman <philip at yhbt.com>
+ #
+ # Version 1.0 (1/8/08)
+ # Fixed CXXTEST_INCLUDE_DIRS so it will work properly
+ # Eliminated superfluous CXXTEST_FOUND assignment
+ # Cleaned up and added more documentation
+ #=============================================================
+ # CXXTEST_ADD_TEST (public macro)
+ #=============================================================
MACRO(CXXTEST_ADD_TEST _cxxtest_testname _cxxtest_outfname)
SET(_cxxtest_real_outfname ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_outfname})
IF(CXXTEST_USE_PYTHON)
SET(_cxxtest_executable ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE})
! ELSE()
SET(_cxxtest_executable ${CXXTEST_PERL_TESTGEN_EXECUTABLE})
! ENDIF()
ADD_CUSTOM_COMMAND(
***************
*** 61,82 ****
IF(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
- # The test binary is in CMAKE_RUNTIME_OUTPUT_DIRECTORY
ADD_TEST(${_cxxtest_testname} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_cxxtest_testname})
-
ELSEIF(EXECUTABLE_OUTPUT_PATH)
ADD_TEST(${_cxxtest_testname} ${EXECUTABLE_OUTPUT_PATH}/${_cxxtest_testname})
!
! ELSE(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
ADD_TEST(${_cxxtest_testname} ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_testname})
!
! ENDIF(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
ENDMACRO(CXXTEST_ADD_TEST)
! #=========
! # main
! #=========
! FIND_PATH(CXXTEST_INCLUDE_DIR cxxtest/SelfTest.h)
FIND_PROGRAM(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl)
FIND_PROGRAM(CXXTEST_PYTHON_TESTGEN_EXECUTABLE cxxtestgen.py)
--- 92,109 ----
IF(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
ADD_TEST(${_cxxtest_testname} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_cxxtest_testname})
ELSEIF(EXECUTABLE_OUTPUT_PATH)
ADD_TEST(${_cxxtest_testname} ${EXECUTABLE_OUTPUT_PATH}/${_cxxtest_testname})
! ELSE()
ADD_TEST(${_cxxtest_testname} ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_testname})
! ENDIF()
ENDMACRO(CXXTEST_ADD_TEST)
! #=============================================================
! # main()
! #=============================================================
! FIND_PATH(CXXTEST_INCLUDE_DIR cxxtest/TestSuite.h)
FIND_PROGRAM(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl)
FIND_PROGRAM(CXXTEST_PYTHON_TESTGEN_EXECUTABLE cxxtestgen.py)
***************
*** 84,90 ****
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG CXXTEST_INCLUDE_DIR)
! IF(CXXTEST_INCLUDE_DIR)
! SET(CXXTEST_INCLUDE_DIRS ${CXXTEST_INCLUDE_DIR})
! SET(CXXTEST_FOUND true)
! ENDIF(CXXTEST_INCLUDE_DIR)
!
--- 111,113 ----
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG CXXTEST_INCLUDE_DIR)
! SET(CXXTEST_INCLUDE_DIRS ${CXXTEST_INCLUDE_DIR})
More information about the Cmake-commits
mailing list