Boost logo

Boost-Commit :

From: dgregor_at_[hidden]
Date: 2007-05-22 19:27:34


Author: dgregor
Date: 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
New Revision: 4200
URL: http://svn.boost.org/trac/boost/changeset/4200

Log:
tools/build/CMake/boost-testing.cmake:
  - Put COMPILE_FLAGS on the target of tests, not the source
  - Bring boost_test_run_fail (almost) in line with boost_test_run

Testing support for rational, serialization (incomplete), program_options,
range, random, property map, and pointer container libraries

Added:
   sandbox/troy/boost_1_34_0/libs/program_options/test/CMakeLists.txt
   sandbox/troy/boost_1_34_0/libs/property_map/CMakeLists.txt
   sandbox/troy/boost_1_34_0/libs/property_map/test/CMakeLists.txt
   sandbox/troy/boost_1_34_0/libs/ptr_container/CMakeLists.txt
   sandbox/troy/boost_1_34_0/libs/ptr_container/test/CMakeLists.txt
   sandbox/troy/boost_1_34_0/libs/random/CMakeLists.txt
   sandbox/troy/boost_1_34_0/libs/random/test/CMakeLists.txt
   sandbox/troy/boost_1_34_0/libs/range/CMakeLists.txt
   sandbox/troy/boost_1_34_0/libs/range/test/CMakeLists.txt
   sandbox/troy/boost_1_34_0/libs/rational/CMakeLists.txt
   sandbox/troy/boost_1_34_0/libs/rational/test/
   sandbox/troy/boost_1_34_0/libs/rational/test/CMakeLists.txt
   sandbox/troy/boost_1_34_0/libs/serialization/test/CMakeLists.txt
Text files modified:
   sandbox/troy/boost_1_34_0/TODO | 6 ++++++
   sandbox/troy/boost_1_34_0/libs/program_options/CMakeLists.txt | 1 +
   sandbox/troy/boost_1_34_0/libs/serialization/CMakeLists.txt | 1 +
   sandbox/troy/boost_1_34_0/libs/serialization/src/CMakeLists.txt | 3 ++-
   sandbox/troy/boost_1_34_0/tools/build/CMake/boost-testing.cmake | 14 +++++++-------
   5 files changed, 17 insertions(+), 8 deletions(-)

Modified: sandbox/troy/boost_1_34_0/TODO
==============================================================================
--- sandbox/troy/boost_1_34_0/TODO (original)
+++ sandbox/troy/boost_1_34_0/TODO 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -23,3 +23,9 @@
 - In libs/numeric/interval/test, how to detect OSF and HP's C++ compiler?
 
 - In libs/parameter/test, fix the test that depends on Python
+
+- Everything for the Python library
+
+- Testing for the Regex library
+
+

Modified: sandbox/troy/boost_1_34_0/libs/program_options/CMakeLists.txt
==============================================================================
--- sandbox/troy/boost_1_34_0/libs/program_options/CMakeLists.txt (original)
+++ sandbox/troy/boost_1_34_0/libs/program_options/CMakeLists.txt 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -1,4 +1,5 @@
 boost_library_project(
   Program_Options
   SRCDIRS src
+ TESTDIRS test
   )
\ No newline at end of file

Added: sandbox/troy/boost_1_34_0/libs/program_options/test/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/libs/program_options/test/CMakeLists.txt 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -0,0 +1,19 @@
+set(PROGRAM_OPTIONS_LIBRARIES
+ boost_program_options-static
+ boost_test_exec_monitor-static)
+
+macro(program_options_test_run TESTNAME)
+ boost_test_run(${TESTNAME}
+ LIBRARIES boost_program_options-static boost_test_exec_monitor-static)
+ boost_test_run("${TESTNAME}_dll"
+ SOURCES "${TESTNAME}.cpp"
+ LIBRARIES boost_program_options-static boost_test_exec_monitor-shared)
+endmacro(program_options_test_run)
+
+program_options_test_run(options_description_test)
+program_options_test_run(parsers_test)
+program_options_test_run(variable_map_test)
+program_options_test_run(cmdline_test)
+program_options_test_run(positional_options_test)
+program_options_test_run(unicode_test)
+program_options_test_run(winmain)

Added: sandbox/troy/boost_1_34_0/libs/property_map/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/libs/property_map/CMakeLists.txt 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -0,0 +1,4 @@
+boost_library_project(
+ Property_Map
+ TESTDIRS test
+ )
\ No newline at end of file

Added: sandbox/troy/boost_1_34_0/libs/property_map/test/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/libs/property_map/test/CMakeLists.txt 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -0,0 +1,2 @@
+boost_test_compile(property_map_cc)
+boost_test_run(dynamic_properties_test)
\ No newline at end of file

Added: sandbox/troy/boost_1_34_0/libs/ptr_container/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/libs/ptr_container/CMakeLists.txt 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -0,0 +1,4 @@
+boost_library_project(
+ Pointer_Containers
+ TESTDIRS test
+ )
\ No newline at end of file

Added: sandbox/troy/boost_1_34_0/libs/ptr_container/test/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/libs/ptr_container/test/CMakeLists.txt 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -0,0 +1,14 @@
+boost_test_run(ptr_vector LIBRARIES boost_unit_test_framework-static)
+boost_test_run(ptr_list LIBRARIES boost_unit_test_framework-static)
+boost_test_run(ptr_deque LIBRARIES boost_unit_test_framework-static)
+boost_test_run(ptr_set LIBRARIES boost_unit_test_framework-static)
+boost_test_run(ptr_map LIBRARIES boost_unit_test_framework-static)
+boost_test_run(ptr_array LIBRARIES boost_unit_test_framework-static)
+boost_test_run(tree_test LIBRARIES boost_unit_test_framework-static)
+boost_test_run(incomplete_type_test LIBRARIES boost_unit_test_framework-static)
+boost_test_run(view_example LIBRARIES boost_unit_test_framework-static)
+boost_test_run(iterator_test LIBRARIES boost_unit_test_framework-static)
+boost_test_run(tut1 LIBRARIES boost_unit_test_framework-static)
+boost_test_run(indirect_fun LIBRARIES boost_unit_test_framework-static)
+boost_test_run(serialization LIBRARIES boost_unit_test_framework-static boost_serialization-static)
+boost_test_run(no_exceptions LIBRARIES boost_unit_test_framework-static)

Added: sandbox/troy/boost_1_34_0/libs/random/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/libs/random/CMakeLists.txt 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -0,0 +1,4 @@
+boost_library_project(
+ Random
+ TESTDIRS test
+ )
\ No newline at end of file

Added: sandbox/troy/boost_1_34_0/libs/random/test/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/libs/random/test/CMakeLists.txt 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -0,0 +1,7 @@
+boost_test_run(random_test SOURCES ../random_test.cpp)
+boost_test_run(random_demo SOURCES ../random_demo.cpp)
+# TODO: These tests were commented out in the Jamfile.v2:
+# [ run libs/random/nondet_random_speed.cpp ]
+# [ run libs/random/random_device.cpp ]
+# [ run libs/random/random_speed.cpp ]
+# [ run libs/random/statistic_tests.cpp ]

Added: sandbox/troy/boost_1_34_0/libs/range/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/libs/range/CMakeLists.txt 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -0,0 +1,4 @@
+boost_library_project(
+ Range
+ TESTDIRS test
+ )
\ No newline at end of file

Added: sandbox/troy/boost_1_34_0/libs/range/test/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/libs/range/test/CMakeLists.txt 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -0,0 +1,11 @@
+boost_test_run(array LIBRARIES boost_unit_test_framework-static)
+boost_test_run(iterator_pair LIBRARIES boost_unit_test_framework-static)
+boost_test_run(std_container LIBRARIES boost_unit_test_framework-static)
+boost_test_run(string LIBRARIES boost_unit_test_framework-static)
+boost_test_run(iterator_range LIBRARIES boost_unit_test_framework-static)
+boost_test_run(sub_range LIBRARIES boost_unit_test_framework-static)
+boost_test_run(partial_workaround LIBRARIES boost_unit_test_framework-static)
+boost_test_run(algorithm_example LIBRARIES boost_unit_test_framework-static)
+boost_test_run(reversible_range LIBRARIES boost_unit_test_framework-static)
+boost_test_run(const_ranges LIBRARIES boost_unit_test_framework-static)
+boost_test_run(extension_mechanism LIBRARIES boost_unit_test_framework-static)

Added: sandbox/troy/boost_1_34_0/libs/rational/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/libs/rational/CMakeLists.txt 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -0,0 +1,4 @@
+boost_library_project(
+ Rational
+ TESTDIRS test
+ )
\ No newline at end of file

Added: sandbox/troy/boost_1_34_0/libs/rational/test/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/libs/rational/test/CMakeLists.txt 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -0,0 +1,5 @@
+boost_test_run(rational_example SOURCES ../rational_example.cpp)
+boost_test_run(rational_test
+ SOURCES ../rational_test.cpp
+ LIBRARIES boost_unit_test_framework-static
+ )
\ No newline at end of file

Modified: sandbox/troy/boost_1_34_0/libs/serialization/CMakeLists.txt
==============================================================================
--- sandbox/troy/boost_1_34_0/libs/serialization/CMakeLists.txt (original)
+++ sandbox/troy/boost_1_34_0/libs/serialization/CMakeLists.txt 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -1,4 +1,5 @@
 boost_library_project(
   Serialization
   SRCDIRS src
+ TESTDIRS test
 )

Modified: sandbox/troy/boost_1_34_0/libs/serialization/src/CMakeLists.txt
==============================================================================
--- sandbox/troy/boost_1_34_0/libs/serialization/src/CMakeLists.txt (original)
+++ sandbox/troy/boost_1_34_0/libs/serialization/src/CMakeLists.txt 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -50,7 +50,8 @@
 option(BUILD_BOOST_WSERIALIZATION "Build wide-char boost serialization libs" ON)
 if (BUILD_BOOST_WSERIALIZATION)
   boost_library(boost_wserialization
- ${SOURCES} ${WSOURCES}
+ ${WSOURCES}
     SHARED_COMPILE_FLAGS -DBOOST_SERIALIZATION_DYN_LINK=1
+ -DBOOST_WSERIALIZATION_DYN_LINK=1
     )
 endif(BUILD_BOOST_WSERIALIZATION)

Added: sandbox/troy/boost_1_34_0/libs/serialization/test/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/libs/serialization/test/CMakeLists.txt 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -0,0 +1,88 @@
+# The set of archives that we will use for testing the Serialization
+# library
+set(BOOST_ARCHIVE_LIST
+ "text_archive"
+ "text_warchive"
+ "binary_archive"
+ "xml_archive"
+ "xml_warchive"
+ )
+
+# The serialization_test macro declares a set of tests of the
+# serialization library. For each invocation of serialization_test,
+# this macro will build separate static and dynamic tests for each
+# archive type listed in BOOST_ARCHIVE_LIST.
+macro(serialization_test testname)
+ parse_arguments(BSL_TEST "" "NO_LIBS" ${ARGN})
+
+ foreach(ARCHIVE ${BOOST_ARCHIVE_LIST})
+ set(BSL_TEST_STATIC_LIBRARIES)
+ set(BSL_TEST_SHARED_LIBRARIES)
+ if(NOT BSL_NO_LIBS)
+ set(BSL_TEST_STATIC_LIBRARIES "boost_serialization-static")
+ set(BSL_TEST_SHARED_LIBRARIES "boost_serialization-shared")
+ if(ARCHIVE MATCHES ".*warchive")
+ set(BSL_TEST_STATIC_LIBRARIES
+ "boost_wserialization-static" ${BSL_TEST_STATIC_LIBRARIES})
+ set(BSL_TEST_SHARED_LIBRARIES
+ "boost_wserialization-static" ${BSL_TEST_SHARED_LIBRARIES})
+ endif(ARCHIVE MATCHES ".*warchive")
+ endif(NOT BSL_NO_LIBS)
+
+ # Tests linking against the static serialization library
+ boost_test_run("${testname}_${ARCHIVE}"
+ SOURCES "${testname}.cpp"
+ LIBRARIES boost_test_exec_monitor-static ${BSL_TEST_STATIC_LIBRARIES}
+ COMPILE_FLAGS "-DBOOST_ARCHIVE_TEST=${ARCHIVE}.hpp -DBOOST_LIB_DIAGNOSTIC=1")
+
+ # Tests linking against the shared serialization library
+ boost_test_run("${testname}_${ARCHIVE}_dll"
+ SOURCES "${testname}.cpp"
+ LIBRARIES boost_test_exec_monitor-static ${BSL_TEST_SHARED_LIBRARIES}
+ COMPILE_FLAGS "-DBOOST_LIB_DIAGNOSTIC=1 -DBOOST_ALL_DYN_LINK=1"
+ -DBOOST_ARCHIVE_TEST=${ARCHIVE}.hpp)
+ endforeach(ARCHIVE ${BOOST_ARCHIVE_LIST})
+endmacro(serialization_test)
+
+serialization_test(test_array)
+serialization_test(test_binary)
+serialization_test(test_contained_class)
+serialization_test(test_cyclic_ptrs)
+serialization_test(test_delete_pointer)
+serialization_test(test_deque)
+serialization_test(test_derived)
+serialization_test(test_derived_class)
+serialization_test(test_derived_class_ptr)
+serialization_test(test_diamond)
+serialization_test(test_exported)
+serialization_test(test_class_info_load)
+serialization_test(test_class_info_save)
+serialization_test(test_object)
+serialization_test(test_primitive)
+serialization_test(test_list)
+serialization_test(test_list_ptrs)
+serialization_test(test_map)
+serialization_test(test_mi)
+serialization_test(test_multiple_ptrs)
+serialization_test(test_no_rtti)
+serialization_test(test_non_intrusive)
+serialization_test(test_non_default_ctor)
+serialization_test(test_non_default_ctor2)
+serialization_test(test_null_ptr)
+serialization_test(test_nvp)
+serialization_test(test_recursion)
+serialization_test(test_registered)
+serialization_test(test_set)
+serialization_test(test_simple_class)
+serialization_test(test_simple_class_ptr)
+serialization_test(test_split)
+serialization_test(test_tracking)
+serialization_test(test_unregistered)
+serialization_test(test_variant)
+serialization_test(test_vector)
+serialization_test(test_optional)
+serialization_test(test_shared_ptr)
+serialization_test(test_shared_ptr_132)
+# TODO
+# [ test-bsl-run_polymorphic_archive test_polymorphic : test_polymorphic_A ]
+

Modified: sandbox/troy/boost_1_34_0/tools/build/CMake/boost-testing.cmake
==============================================================================
--- sandbox/troy/boost_1_34_0/tools/build/CMake/boost-testing.cmake (original)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/boost-testing.cmake 2007-05-22 19:27:32 EDT (Tue, 22 May 2007)
@@ -79,10 +79,8 @@
     add_executable(${testname} ${BOOST_TEST_SOURCES})
     set_target_properties(${testname}
       PROPERTIES
- OUTPUT_NAME ${PROJECT_NAME}/${testname})
- set_source_files_properties(${BOOST_TEST_SOURCES}
       COMPILE_FLAGS "${BOOST_TEST_COMPILE_FLAGS}"
- )
+ OUTPUT_NAME ${PROJECT_NAME}/${testname})
     target_link_libraries(${testname} ${BOOST_TEST_DEPENDS})
     target_link_libraries(${testname} ${BOOST_TEST_LIBRARIES})
     foreach(_depend ${BOOST_TEST_DEPENDS})
@@ -103,10 +101,12 @@
   boost_test_parse_args(${testname} ${ARGN})
   if(BOOST_TEST_OKAY)
     add_executable(${testname} ${BOOST_TEST_SOURCES})
-
- if (BOOST_TEST_DEPENDS)
- target_link_libraries(${testname} ${BOOST_TEST_DEPENDS})
- endif(BOOST_TEST_DEPENDS)
+ set_target_properties(${testname}
+ PROPERTIES
+ COMPILE_FLAGS "${BOOST_TEST_COMPILE_FLAGS}"
+ OUTPUT_NAME ${PROJECT_NAME}/${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})
     set_tests_properties("${PROJECT_NAME}::${testname}" PROPERTIES WILL_FAIL TRUE)


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