|
Boost-Commit : |
From: dgregor_at_[hidden]
Date: 2007-06-06 00:10:05
Author: dgregor
Date: 2007-06-06 00:10:03 EDT (Wed, 06 Jun 2007)
New Revision: 4464
URL: http://svn.boost.org/trac/boost/changeset/4464
Log:
- Building the Boost.Python library
- Testing for the Statechart library
- Testing for the Spirit library
- First stab at link tests
- Cleanups in the handling of THIS_VARIANT_LINK_LIBS
Added:
sandbox-branches/boost-cmake/boost_1_34_0/libs/python/CMakeLists.txt
sandbox-branches/boost-cmake/boost_1_34_0/libs/python/src/CMakeLists.txt
sandbox-branches/boost-cmake/boost_1_34_0/libs/python/test/CMakeLists.txt
sandbox-branches/boost-cmake/boost_1_34_0/libs/spirit/CMakeLists.txt
sandbox-branches/boost-cmake/boost_1_34_0/libs/spirit/test/CMakeLists.txt
sandbox-branches/boost-cmake/boost_1_34_0/libs/spirit/test/actor/CMakeLists.txt
sandbox-branches/boost-cmake/boost_1_34_0/libs/spirit/test/typeof_support/CMakeLists.txt
sandbox-branches/boost-cmake/boost_1_34_0/libs/statechart/example/CMakeLists.txt
sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/LinkTest/
sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/LinkTest/CMakeLists.txt
Text files modified:
sandbox-branches/boost-cmake/boost_1_34_0/TODO | 9 +++++++--
sandbox-branches/boost-cmake/boost_1_34_0/libs/statechart/CMakeLists.txt | 2 +-
sandbox-branches/boost-cmake/boost_1_34_0/libs/statechart/test/CMakeLists.txt | 11 +----------
sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-core.cmake | 11 +++--------
sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-testing.cmake | 17 ++++++++++++++++-
5 files changed, 28 insertions(+), 22 deletions(-)
Modified: sandbox-branches/boost-cmake/boost_1_34_0/TODO
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/TODO (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/TODO 2007-06-06 00:10:03 EDT (Wed, 06 Jun 2007)
@@ -18,13 +18,18 @@
- In libs/parameter/test, fix the test that depends on Python
-- Everything for the Python library
+- Python library: testing, handle Python debug library variants
- Testing for the Regex library
-- Testing for the Spirit library
+- Spirit library: multi-threaded tests. There must be an easy way to
+ handle this... support variants in testing? (I think we need
+ "boost_add_executable" to handle these...)
- Statechart library: deal with building libraries for testing, and
with link-only tests.
+- list_contains seems to think that "SOURCES"
+ is equivalent to "BitMachine/BitMachine.cpp" (???)
- Xpressive: port multipledefs and msvc-stlport tests
+
Added: sandbox-branches/boost-cmake/boost_1_34_0/libs/python/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox-branches/boost-cmake/boost_1_34_0/libs/python/CMakeLists.txt 2007-06-06 00:10:03 EDT (Wed, 06 Jun 2007)
@@ -0,0 +1,11 @@
+include(FindPythonInterp)
+include(FindPythonLibs)
+
+if (PYTHON_LIBRARIES)
+ include_directories(${PYTHON_INCLUDE_PATH})
+ boost_library_project(
+ Python
+ SRCDIRS src
+ TESTDIRS test
+ )
+endif (PYTHON_LIBRARIES)
\ No newline at end of file
Added: sandbox-branches/boost-cmake/boost_1_34_0/libs/python/src/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox-branches/boost-cmake/boost_1_34_0/libs/python/src/CMakeLists.txt 2007-06-06 00:10:03 EDT (Wed, 06 Jun 2007)
@@ -0,0 +1,34 @@
+boost_library(boost_python
+ numeric.cpp
+ list.cpp
+ long.cpp
+ dict.cpp
+ tuple.cpp
+ str.cpp
+ slice.cpp
+ aix_init_module.cpp
+ converter/from_python.cpp
+ converter/registry.cpp
+ converter/type_id.cpp
+ object/enum.cpp
+ object/class.cpp
+ object/function.cpp
+ object/inheritance.cpp
+ object/life_support.cpp
+ object/pickle_support.cpp
+ errors.cpp
+ module.cpp
+ converter/builtin_converters.cpp
+ converter/arg_to_python_base.cpp
+ object/iterator.cpp
+ object/stl_iterator.cpp
+ object_protocol.cpp
+ object_operators.cpp
+ wrapper.cpp
+ import.cpp
+ exec.cpp
+
+ STATIC_COMPILE_FLAGS "-DBOOST_PYTHON_SOURCE -DBOOST_PYTHON_STATIC_LIB"
+ SHARED_COMPILE_FLAGS "-DBOOST_PYTHON_SOURCE"
+ LINK_LIBS "${PYTHON_LIBRARIES}"
+ )
\ No newline at end of file
Added: sandbox-branches/boost-cmake/boost_1_34_0/libs/python/test/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox-branches/boost-cmake/boost_1_34_0/libs/python/test/CMakeLists.txt 2007-06-06 00:10:03 EDT (Wed, 06 Jun 2007)
@@ -0,0 +1,9 @@
+boost_test_run(exec
+ DEPENDS boost_python-static
+ ARGS "${CMAKE_CURRENT_SOURCE_DIR}/exec.py"
+ LINK_LIBS ${PYTHON_LIBRARIES})
+boost_test_run(exec-dynamic
+ SOURCES exec.cpp
+ ARGS "${CMAKE_CURRENT_SOURCE_DIR}/exec.py"
+ DEPENDS boost_python-shared
+ LINK_LIBS ${PYTHON_LIBRARIES})
\ No newline at end of file
Added: sandbox-branches/boost-cmake/boost_1_34_0/libs/spirit/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox-branches/boost-cmake/boost_1_34_0/libs/spirit/CMakeLists.txt 2007-06-06 00:10:03 EDT (Wed, 06 Jun 2007)
@@ -0,0 +1,4 @@
+boost_library_project(
+ Spirit
+ TESTDIRS test
+ )
\ No newline at end of file
Added: sandbox-branches/boost-cmake/boost_1_34_0/libs/spirit/test/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox-branches/boost-cmake/boost_1_34_0/libs/spirit/test/CMakeLists.txt 2007-06-06 00:10:03 EDT (Wed, 06 Jun 2007)
@@ -0,0 +1,122 @@
+macro(spirit_run TESTNAME)
+ parse_arguments(SPIRIT_RUN "SOURCES" "" ${ARGN})
+
+ if (NOT SPIRIT_RUN_SOURCES)
+ set(SPIRIT_RUN_SOURCES "${TESTNAME}.cpp")
+ endif (NOT SPIRIT_RUN_SOURCES)
+
+ boost_test_run(${TESTNAME}
+ SOURCES ${SPIRIT_RUN_SOURCES}
+ ${ARGN}
+ )
+ boost_test_run(${TESTNAME}_debug
+ COMPILE_FLAGS "-DBOOST_SPIRIT_DEBUG=1"
+ SOURCES ${SPIRIT_RUN_SOURCES}
+ ${ARGN}
+ )
+endmacro(spirit_run)
+
+if(MSVC)
+ # For Visual C++, turn on optimizations
+ set(OPT_FLAGS "${CMAKE_CXX_FLAGS_RELEASE}")
+else(MSVC)
+ set(OPT_FLAGS "")
+endif(MSVC)
+
+# spirit.core.kernel
+spirit_run(match_tests)
+
+# spirit.core.scanner
+spirit_run(scanner_tests)
+spirit_run(scanner_value_type_tests)
+
+# spirit.core.primitive
+spirit_run(primitives_tests)
+spirit_run(char_strings_test)
+boost_test_compile_fail(char_strings_test_fail)
+spirit_run(numerics_tests COMPILE_FLAGS "${OPT_FLAGS}")
+
+# spirit.core.composite
+spirit_run(epsilon_tests)
+spirit_run(negated_eps_p_test)
+spirit_run(operators_tests)
+spirit_run(directives_tests)
+spirit_run(shortest_alternative_tests)
+
+# spirit.core.non_terminal
+spirit_run(rule_tests)
+spirit_run(owi_st_tests)
+spirit_run(grammar_tests COMPILE_FLAGS "${OPT_FLAGS}")
+spirit_run(grammar_multi_instance_tst COMPILE_FLAGS "${OPT_FLAGS}")
+spirit_run(subrule_tests)
+# TODO: [ run owi_mt_tests.cpp : : : $(multi-threading) ]
+# TODO: [ run grammar_mt_tests.cpp : : : $(multi-threading) ]
+spirit_run(parser_context_test)
+
+# spirit.meta
+spirit_run(fundamental_tests)
+spirit_run(parser_traits_tests)
+spirit_run(traverse_tests)
+
+# spirit.attribute
+spirit_run(closure_tests COMPILE_FLAGS "${OPT_FLAGS}")
+# [ run bug_000008.cpp : : : $(multi-threading) ]
+spirit_run(parametric_tests)
+
+# spirit.error_handling
+spirit_run(exception_tests)
+
+# spirit.tree
+spirit_run(ast_calc_tests)
+spirit_run(group_match_bug)
+spirit_run(repeat_ast_tests)
+boost_test_compile(mix_and_match_trees)
+
+# temporarily removed from the test suite. tree_tests are not finished, yet.
+# spirit_run(tree_tests)
+
+# spirit.dynamic
+boost_test_compile(if_p_as_parser_tests)
+boost_test_compile(while_p_as_parser_tests)
+boost_test_compile(for_p_as_parser_tests)
+spirit_run(if_tests)
+spirit_run(if_p_int_as_condition_test)
+spirit_run(for_tests)
+spirit_run(while_tests)
+spirit_run(lazy_tests)
+spirit_run(switch_tests_eps_default)
+spirit_run(switch_tests_general_def)
+spirit_run(switch_tests_wo_default)
+spirit_run(switch_tests_single)
+spirit_run(switch_problem)
+spirit_run(select_p_with_rule)
+
+# spirit.utility.parsers
+spirit_run(chset_tests)
+spirit_run(confix_tests)
+spirit_run(loops_tests)
+spirit_run(symbols_tests)
+spirit_run(symbols_add_null)
+spirit_run(symbols_find_null)
+spirit_run(escape_char_parser_tests COMPILE_FLAGS "${OPT_FLAGS}")
+spirit_run(distinct_tests)
+spirit_run(grammar_def_test)
+
+# spirit.utility.support
+# This test doesn't actually use multiple threads
+# spirit_run(scoped_lock_tests : : : $(multi-threading) ]
+
+# spirit.iterator
+spirit_run(fixed_size_queue_tests)
+boost_test_compile_fail(fixed_size_queue_fail_tests)
+spirit_run(file_iterator_tests)
+spirit_run(multi_pass_tests COMPILE_FLAGS "${OPT_FLAGS}")
+spirit_run(sf_bug_720917 COMPILE_FLAGS "${OPT_FLAGS}")
+spirit_run(position_iterator_tests COMPILE_FLAGS "${OPT_FLAGS}")
+boost_test_compile(multi_pass_compile_tests)
+
+# spirit.small_bug_fixes
+spirit_run(bug_fixes)
+
+add_subdirectory(actor)
+add_subdirectory(typeof_support)
Added: sandbox-branches/boost-cmake/boost_1_34_0/libs/spirit/test/actor/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox-branches/boost-cmake/boost_1_34_0/libs/spirit/test/actor/CMakeLists.txt 2007-06-06 00:10:03 EDT (Wed, 06 Jun 2007)
@@ -0,0 +1,14 @@
+# spirit.utility.actors
+spirit_run(action_tests
+ SOURCES action_tests.cpp
+ assign_test.cpp
+ assign_key_test.cpp
+ clear_test.cpp
+ decrement_test.cpp
+ erase_at_test.cpp
+ increment_test.cpp
+ insert_key_test.cpp
+ insert_at_test.cpp
+ push_back_test.cpp
+ push_front_test.cpp
+ swap_test.cpp)
Added: sandbox-branches/boost-cmake/boost_1_34_0/libs/spirit/test/typeof_support/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox-branches/boost-cmake/boost_1_34_0/libs/spirit/test/typeof_support/CMakeLists.txt 2007-06-06 00:10:03 EDT (Wed, 06 Jun 2007)
@@ -0,0 +1,12 @@
+# spirit.typeof-support
+boost_test_compile(typeof_actor)
+boost_test_compile(typeof_attribute)
+boost_test_compile(typeof_core)
+boost_test_compile(typeof_debug)
+boost_test_compile(typeof_dynamic)
+boost_test_compile(typeof_error_handling)
+boost_test_compile(typeof_iterator)
+boost_test_compile(typeof_symbols)
+boost_test_compile(typeof_tree)
+boost_test_compile(typeof_utility)
+
Modified: sandbox-branches/boost-cmake/boost_1_34_0/libs/statechart/CMakeLists.txt
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/libs/statechart/CMakeLists.txt (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/libs/statechart/CMakeLists.txt 2007-06-06 00:10:03 EDT (Wed, 06 Jun 2007)
@@ -1,4 +1,4 @@
boost_library_project(
Statechart
- TESTDIRS test
+ TESTDIRS test example
)
\ No newline at end of file
Added: sandbox-branches/boost-cmake/boost_1_34_0/libs/statechart/example/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox-branches/boost-cmake/boost_1_34_0/libs/statechart/example/CMakeLists.txt 2007-06-06 00:10:03 EDT (Wed, 06 Jun 2007)
@@ -0,0 +1,25 @@
+macro(statechart_example TESTNAME)
+ set(SOURCES)
+ foreach(ARG ${ARGN})
+ set(SOURCES ${SOURCES} "${TESTNAME}/${ARG}.cpp")
+ endforeach(ARG ${ARGN})
+
+ if (NOT SOURCES)
+ set(SOURCES "${TESTNAME}/${TESTNAME}.cpp")
+ endif (NOT SOURCES)
+
+ boost_test_link("${TESTNAME}Example"
+ SOURCES ${SOURCES}
+ COMPILE_FLAGS "-DBOOST_DISABLE_THREADS"
+ )
+endmacro(statechart_example)
+
+statechart_example(BitMachine)
+#statechart_example(Camera
+# : Camera : Camera Configuring Main Shooting)
+#statechart_example(Handcrafted : Handcrafted : Handcrafted)
+#statechart_example(Keyboard : Keyboard : Keyboard :)
+#statechart_example(Performance : Performance : Performance)
+#statechart_example(PingPong : PingPong : PingPong)
+#statechart_example(StopWatch : StopWatch : StopWatch)
+#statechart_example(StopWatch2 : StopWatch : StopWatch2) ;
Modified: sandbox-branches/boost-cmake/boost_1_34_0/libs/statechart/test/CMakeLists.txt
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/libs/statechart/test/CMakeLists.txt (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/libs/statechart/test/CMakeLists.txt 2007-06-06 00:10:03 EDT (Wed, 06 Jun 2007)
@@ -39,6 +39,7 @@
)
endmacro(statechart_run)
+
statechart_compile_fail(InvalidChartTest1)
statechart_compile_fail(InvalidChartTest2)
statechart_compile_fail(InvalidChartTest3)
@@ -78,13 +79,3 @@
#statechart-st-lib-run DllTestNative
# : TuTestMain : TuTest : <link>shared $(native))
-# TODO: These tests need support for link-only tests.
-#statechart-st-compile-example BitMachine : BitMachine : BitMachine)
-#statechart-st-compile-example Camera
-# : Camera : Camera Configuring Main Shooting)
-#statechart-st-compile-example Handcrafted : Handcrafted : Handcrafted)
-#statechart-st-compile-example Keyboard : Keyboard : Keyboard :)
-#statechart-st-compile-example Performance : Performance : Performance)
-#statechart-st-compile-example PingPong : PingPong : PingPong)
-#statechart-st-compile-example StopWatch : StopWatch : StopWatch)
-#statechart-st-compile-example StopWatch2 : StopWatch : StopWatch2) ;
Added: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/LinkTest/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/LinkTest/CMakeLists.txt 2007-06-06 00:10:03 EDT (Wed, 06 Jun 2007)
@@ -0,0 +1,3 @@
+project(LinkTest)
+include_directories (${INCLUDES})
+add_executable(link ${SOURCE} COMPILE_FLAGS "${COMPILE_FLAGS}")
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-06-06 00:10:03 EDT (Wed, 06 Jun 2007)
@@ -146,7 +146,7 @@
macro(boost_library_variant LIBNAME)
set(THIS_VARIANT_COMPILE_FLAGS "${THIS_LIB_COMPILE_FLAGS}")
set(THIS_VARIANT_LINK_FLAGS "${THIS_LIB_LINK_FLAGS}")
- set(THIS_VARIANT_LINK_LIBS "${THIS_LIB_LINK_LIBS}")
+ set(THIS_VARIANT_LINK_LIBS ${THIS_LIB_LINK_LIBS})
# Determine if it is okay to build this variant
set(THIS_VARIANT_OKAY TRUE)
@@ -169,7 +169,7 @@
# Accumulate compile and link flags
set(THIS_VARIANT_COMPILE_FLAGS "${THIS_VARIANT_COMPILE_FLAGS} ${THIS_LIB_${ARG}_COMPILE_FLAGS} ${${ARG}_COMPILE_FLAGS}")
set(THIS_VARIANT_LINK_FLAGS "${THIS_VARIANT_LINK_FLAGS} ${THIS_LIB_${ARG}_LINK_FLAGS} ${${ARG}_LINK_FLAGS}")
- set(THIS_VARIANT_LINK_LIBS "${THIS_VARIANT_LINK_LIBS} ${THIS_LIB_${ARG}_LINK_LIBS} ${${ARG}_LINK_LIBS}")
+ set(THIS_VARIANT_LINK_LIBS ${THIS_VARIANT_LINK_LIBS} ${THIS_LIB_${ARG}_LINK_LIBS} ${${ARG}_LINK_LIBS})
endforeach(ARG ${ARGN})
if (THIS_VARIANT_OKAY)
@@ -178,11 +178,9 @@
if (THIS_LIB_IS_DEBUG)
set(THIS_VARIANT_COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG} ${THIS_VARIANT_COMPILE_FLAGS}")
set(THIS_VARIANT_LINK_FLAGS "${CMAKE_LINK_FLAGS_DEBUG} ${THIS_VARIANT_LINK_FLAGS}")
- set(THIS_VARIANT_LINK_LIBS "${THIS_VARIANT_LINK_LIBS}")
else (THIS_LIB_IS_DEBUG)
set(THIS_VARIANT_COMPILE_FLAGS "${CMAKE_CXX_FLAGS_RELEASE} ${THIS_VARIANT_COMPILE_FLAGS}")
set(THIS_VARIANT_LINK_FLAGS "${CMAKE_LINK_FLAGS_RELEASE} ${THIS_VARIANT_LINK_FLAGS}")
- set(THIS_VARIANT_LINK_LIBS "${THIS_VARIANT_LINK_LIBS}")
endif (THIS_LIB_IS_DEBUG)
# Determine the suffix for this library target
@@ -253,10 +251,7 @@
add_dependencies(${LIBNAME} ${VARIANT_LIBNAME})
# Link against whatever libraries this library depends on
- separate_arguments(THIS_VARIANT_LINK_LIBS)
- foreach(library ${THIS_VARIANT_LINK_LIBS})
- target_link_libraries(${VARIANT_LIBNAME} ${library}) # loop maybe unnecessary here
- endforeach(library ${THIS_VARIANT_LINK_LIBS})
+ target_link_libraries(${VARIANT_LIBNAME} ${THIS_VARIANT_LINK_LIBS})
foreach(dependency ${THIS_LIB_DEPENDS})
target_link_libraries(${VARIANT_LIBNAME} "${dependency}${VARIANT_TARGET_NAME}")
endforeach(dependency "${THIS_LIB_DEPENDS}")
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-06-06 00:10:03 EDT (Wed, 06 Jun 2007)
@@ -105,6 +105,21 @@
endif(BOOST_TEST_OKAY)
endmacro(boost_test_run_fail)
+macro(boost_test_link testname)
+ boost_test_parse_args(${testname} ${ARGN})
+ if(BOOST_TEST_OKAY)
+ add_test("${PROJECT_NAME}::${testname}"
+ ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${Boost_SOURCE_DIR}/tools/build/CMake/LinkTest"
+ "${Boost_BINARY_DIR}/tools/build/CMake/LinkTest"
+ --build-generator "${CMAKE_GENERATOR}"
+ --build-makeprogram "${MAKEPROGRAM}"
+ --build-project LinkTest
+ --build-options -DSOURCE=${CMAKE_CURRENT_SOURCE_DIR}/${BOOST_TEST_SOURCES} -DINCLUDES=${Boost_SOURCE_DIR} -DCOMPILE_FLAGS="${BOOST_TEST_COMPILE_FLAGS}")
+ endif(BOOST_TEST_OKAY)
+endmacro(boost_test_link)
+
macro(boost_test_compile testname)
boost_test_parse_args(${testname} ${ARGN})
if(BOOST_TEST_OKAY)
@@ -116,7 +131,7 @@
--build-generator "${CMAKE_GENERATOR}"
--build-makeprogram "${MAKEPROGRAM}"
--build-project CompileTest
- --build-options -DSOURCE=${CMAKE_CURRENT_SOURCE_DIR}/${BOOST_TEST_SOURCES} -DINCLUDES=${Boost_SOURCE_DIR})
+ --build-options -DSOURCE=${CMAKE_CURRENT_SOURCE_DIR}/${BOOST_TEST_SOURCES} -DINCLUDES=${Boost_SOURCE_DIR} -DCOMPILE_FLAGS="${BOOST_TEST_COMPILE_FLAGS}")
endif(BOOST_TEST_OKAY)
endmacro(boost_test_compile)
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