Boost logo

Boost-Commit :

From: troy_at_[hidden]
Date: 2007-05-28 14:00:08


Author: troy
Date: 2007-05-28 14:00:08 EDT (Mon, 28 May 2007)
New Revision: 4331
URL: http://svn.boost.org/trac/boost/changeset/4331

Log:

Some tests were disappearing. Use this workaround. tests go in
bin/test/* and are named project-testname, though they appear as
project::testname in the ctest output.

Text files modified:
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-core.cmake | 4 ----
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-testing.cmake | 32 ++++++++++++++++++++------------
   2 files changed, 20 insertions(+), 16 deletions(-)

Modified: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-core.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-core.cmake (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-core.cmake 2007-05-28 14:00:08 EDT (Mon, 28 May 2007)
@@ -177,10 +177,6 @@
     string(TOLOWER "${libname_}" libname)
     project(${libname})
 
- if(NOT EXISTS ${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME})
- file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME})
- endif(NOT EXISTS ${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME})
-
     # currently src and testdirs are irrelevant. At one point it seemed
     # that they would need to be kept separate and scanned in order
     # CLEANUP: put src/test dirs back together again, if no future

Modified: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-testing.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-testing.cmake (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-testing.cmake 2007-05-28 14:00:08 EDT (Mon, 28 May 2007)
@@ -32,12 +32,15 @@
 #
 # these macros format the displayed name of the test as PROJECT_NAME::testname
 # where PROJECT_NAME is a global set by the cmake PROJECT macro
-# inside boost_library_subproject. this use of a global (hrm) is standard practice
-# in cmakeland but we might not like this...
+# inside boost_library_subproject.
 #
 option(BUILD_TESTING "Enable testing" OFF)
 include(CTest)
 
+if(BUILD_TESTING)
+ file(MAKE_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/test)
+endif(BUILD_TESTING)
+
 macro(boost_test_parse_args testname)
   set(BOOST_TEST_OKAY TRUE)
   set(BOOST_TEST_COMPILE_FLAGS "")
@@ -73,14 +76,15 @@
 
 
 
-macro(boost_test_run testname)
- boost_test_parse_args(${testname} ${ARGN})
+macro(boost_test_run testname_)
+ boost_test_parse_args(${testname_} ${ARGN})
   if (BOOST_TEST_OKAY)
+ set(testname "${PROJECT_NAME}-${testname_}")
     add_executable(${testname} ${BOOST_TEST_SOURCES})
     set_target_properties(${testname}
       PROPERTIES
       COMPILE_FLAGS "${BOOST_TEST_COMPILE_FLAGS}"
- OUTPUT_NAME ${PROJECT_NAME}/${testname})
+ OUTPUT_NAME test/${testname})
     target_link_libraries(${testname} ${BOOST_TEST_DEPENDS})
     target_link_libraries(${testname} ${BOOST_TEST_LIBRARIES})
     foreach(_depend ${BOOST_TEST_DEPENDS})
@@ -91,30 +95,34 @@
         TO_PROPNAME COMPILE_FLAGS
         )
     endforeach(_depend ${BOOST_TEST_DEPENDS})
- add_test("${PROJECT_NAME}::${testname}" ${EXECUTABLE_OUTPUT_PATH}/${PROJECT_NAME}/${testname} ${BOOST_TEST_ARGS})
+ add_test("${PROJECT_NAME}::${testname_}" ${EXECUTABLE_OUTPUT_PATH}/test/${testname} ${BOOST_TEST_ARGS})
   endif(BOOST_TEST_OKAY)
-endmacro(boost_test_run)
+endmacro(boost_test_run testname_)
 
 
 
-macro(boost_test_run_fail testname)
- boost_test_parse_args(${testname} ${ARGN})
+macro(boost_test_run_fail testname_)
+ boost_test_parse_args(${testname_} ${ARGN})
+ set(testname "${PROJECT_NAME}-${testname_}")
   if(BOOST_TEST_OKAY)
     add_executable(${testname} ${BOOST_TEST_SOURCES})
     set_target_properties(${testname}
       PROPERTIES
       COMPILE_FLAGS "${BOOST_TEST_COMPILE_FLAGS}"
- OUTPUT_NAME ${PROJECT_NAME}/${testname})
+ OUTPUT_NAME test/${testname})
     target_link_libraries(${testname} ${BOOST_TEST_DEPENDS})
     target_link_libraries(${testname} ${BOOST_TEST_LIBRARIES})
 
- add_test("${PROJECT_NAME}::${testname}" ${EXECUTABLE_OUTPUT_PATH}/${PROJECT_NAME}/${testname} ${BOOST_TEST_ARGS})
+ add_test("${PROJECT_NAME}::${testname}" ${EXECUTABLE_OUTPUT_PATH}/test/${testname} ${BOOST_TEST_ARGS})
     set_tests_properties("${PROJECT_NAME}::${testname}" PROPERTIES WILL_FAIL TRUE)
   endif(BOOST_TEST_OKAY)
 endmacro(boost_test_run_fail)
 
+#
+# This test will always be listed as "not run"
+#
 macro(boost_test_fail testname)
- add_test("${PROJECT_NAME}::${testname}" false)
+ add_test("${PROJECT_NAME}::${testname}" nonexistent_binary)
 endmacro(boost_test_fail)
 
 macro(boost_test_compile testname)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk