From c22e69c4f1b46db7789507e3f95a546474d84f5f Mon Sep 17 00:00:00 2001 From: Hans Dembinski Date: Tue, 22 Oct 2019 23:32:27 +0100 Subject: [PATCH] Build system fixes - CMake: make compile-fail tests fail for the right reasons not because of missing headers - CMake: run check_odr_test.py - B2: actually run check_odr_test.py and check_build_system.py --- test/CMakeLists.txt | 62 +++++++++++++++++++------ test/Jamfile | 11 ++++- test/{odr_test.py => check_odr_test.py} | 0 3 files changed, 56 insertions(+), 17 deletions(-) rename test/{odr_test.py => check_odr_test.py} (100%) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8a9b0c24..b65c0fe8 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -8,21 +8,52 @@ boost_test(SOURCES check_cmake_version.cpp ARGUMENTS ${PROJECT_VERSION} # checks that b2 and cmake are in sync add_test(NAME check_build_system COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/check_build_system.py) +# checks that all headers are included in odr test +add_test(NAME check_odr_test COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/check_odr_test.py) + # keep in sync with Jamfile, this should be automatized... -boost_test(TYPE compile-fail SOURCES axis_category_fail0.cpp) -boost_test(TYPE compile-fail SOURCES axis_category_fail1.cpp) -boost_test(TYPE compile-fail SOURCES axis_category_fail2.cpp) -boost_test(TYPE compile-fail SOURCES axis_integer_fail0.cpp) -boost_test(TYPE compile-fail SOURCES axis_integer_fail1.cpp) -boost_test(TYPE compile-fail SOURCES axis_integer_fail2.cpp) -boost_test(TYPE compile-fail SOURCES axis_integer_fail3.cpp) -boost_test(TYPE compile-fail SOURCES axis_integer_fail4.cpp) -boost_test(TYPE compile-fail SOURCES axis_regular_fail0.cpp) -boost_test(TYPE compile-fail SOURCES axis_regular_fail1.cpp) -boost_test(TYPE compile-fail SOURCES axis_variable_fail0.cpp) -boost_test(TYPE compile-fail SOURCES axis_variable_fail1.cpp) -boost_test(TYPE compile-fail SOURCES make_histogram_fail0.cpp) -boost_test(TYPE compile-fail SOURCES make_histogram_fail1.cpp) +boost_test(TYPE compile-fail SOURCES axis_category_fail0.cpp + LIBRARIES Boost::histogram +) +boost_test(TYPE compile-fail SOURCES axis_category_fail1.cpp + LIBRARIES Boost::histogram +) +boost_test(TYPE compile-fail SOURCES axis_category_fail2.cpp + LIBRARIES Boost::histogram +) +boost_test(TYPE compile-fail SOURCES axis_integer_fail0.cpp + LIBRARIES Boost::histogram +) +boost_test(TYPE compile-fail SOURCES axis_integer_fail1.cpp + LIBRARIES Boost::histogram +) +boost_test(TYPE compile-fail SOURCES axis_integer_fail2.cpp + LIBRARIES Boost::histogram +) +boost_test(TYPE compile-fail SOURCES axis_integer_fail3.cpp + LIBRARIES Boost::histogram +) +boost_test(TYPE compile-fail SOURCES axis_integer_fail4.cpp + LIBRARIES Boost::histogram +) +boost_test(TYPE compile-fail SOURCES axis_regular_fail0.cpp + LIBRARIES Boost::histogram +) +boost_test(TYPE compile-fail SOURCES axis_regular_fail1.cpp + LIBRARIES Boost::histogram +) +boost_test(TYPE compile-fail SOURCES axis_variable_fail0.cpp + LIBRARIES Boost::histogram +) +boost_test(TYPE compile-fail SOURCES axis_variable_fail1.cpp + LIBRARIES Boost::histogram +) +boost_test(TYPE compile-fail SOURCES make_histogram_fail0.cpp + LIBRARIES Boost::histogram +) +boost_test(TYPE compile-fail SOURCES make_histogram_fail1.cpp + LIBRARIES Boost::histogram +) boost_test(TYPE run SOURCES accumulators_test.cpp LIBRARIES Boost::histogram Boost::core) boost_test(TYPE run SOURCES algorithm_project_test.cpp @@ -119,13 +150,14 @@ endif() ## No cmake support yet # boost_test(TYPE link SOURCES odr_main_test.cpp odr_test.cpp -# LIBRARIES Boost::histogram Boost::core) +# LIBRARIES Boost::histogram Boost::core Boost::serialization) # boost_test(TYPE run SOURCES boost_accumulators_support_test.cpp # LIBRARIES Boost::histogram Boost::core Boost::accumulators) # boost_test(TYPE run SOURCES boost_range_support_test.cpp # LIBRARIES Boost::histogram Boost::core Boost::range) # boost_test(TYPE run SOURCES boost_units_support_test.cpp # LIBRARIES Boost::histogram Boost::core Boost::units) +# boost_test(TYPE run SOURCES detail_array_wrapper_serialization_test.cpp LIBRARIES Boost::histogram Boost::core Boost::serialization) # boost_test(TYPE run SOURCES unlimited_storage_serialization_test.cpp LIBRARIES Boost::histogram Boost::core Boost::serialization) # boost_test(TYPE run SOURCES storage_adaptor_serialization_test.cpp LIBRARIES Boost::histogram Boost::core Boost::serialization) # boost_test(TYPE run SOURCES histogram_serialization_test.cpp LIBRARIES Boost::histogram Boost::core Boost::serialization) diff --git a/test/Jamfile b/test/Jamfile index d357df98..9660d20b 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -12,6 +12,10 @@ import regex ; import testing ; import ../../config/checks/config : requires ; +if ! [ python.configured ] +{ + using python ; +} path-constant THIS_PATH : . ; @@ -23,10 +27,13 @@ project ] ; +# Check consistency of build systems +testing.make-test run-pyd : check_build_system.py : + Jamfile CMakeLists.txt ; + # Verify One Definition Rule by linking two object files which include everything -testing.make-test run-pyd : odr_test.py : : check_odr_test ; +testing.make-test run-pyd : check_odr_test.py : odr_test.cpp ; alias odr : - check_odr_test [ link odr_main_test.cpp odr_test.cpp ] ; diff --git a/test/odr_test.py b/test/check_odr_test.py similarity index 100% rename from test/odr_test.py rename to test/check_odr_test.py