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
This commit is contained in:
Hans Dembinski 2019-10-22 23:32:27 +01:00 committed by GitHub
parent 758c38e566
commit c22e69c4f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 56 additions and 17 deletions

View File

@ -8,21 +8,52 @@ boost_test(SOURCES check_cmake_version.cpp ARGUMENTS ${PROJECT_VERSION}
# checks that b2 and cmake are in sync # checks that b2 and cmake are in sync
add_test(NAME check_build_system COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/check_build_system.py) 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... # 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_fail0.cpp
boost_test(TYPE compile-fail SOURCES axis_category_fail1.cpp) LIBRARIES Boost::histogram
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_category_fail1.cpp
boost_test(TYPE compile-fail SOURCES axis_integer_fail1.cpp) LIBRARIES Boost::histogram
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_category_fail2.cpp
boost_test(TYPE compile-fail SOURCES axis_integer_fail4.cpp) LIBRARIES Boost::histogram
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_integer_fail0.cpp
boost_test(TYPE compile-fail SOURCES axis_variable_fail0.cpp) LIBRARIES Boost::histogram
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 axis_integer_fail1.cpp
boost_test(TYPE compile-fail SOURCES make_histogram_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 boost_test(TYPE run SOURCES accumulators_test.cpp
LIBRARIES Boost::histogram Boost::core) LIBRARIES Boost::histogram Boost::core)
boost_test(TYPE run SOURCES algorithm_project_test.cpp boost_test(TYPE run SOURCES algorithm_project_test.cpp
@ -119,13 +150,14 @@ endif()
## No cmake support yet ## No cmake support yet
# boost_test(TYPE link SOURCES odr_main_test.cpp odr_test.cpp # 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 # boost_test(TYPE run SOURCES boost_accumulators_support_test.cpp
# LIBRARIES Boost::histogram Boost::core Boost::accumulators) # LIBRARIES Boost::histogram Boost::core Boost::accumulators)
# boost_test(TYPE run SOURCES boost_range_support_test.cpp # boost_test(TYPE run SOURCES boost_range_support_test.cpp
# LIBRARIES Boost::histogram Boost::core Boost::range) # LIBRARIES Boost::histogram Boost::core Boost::range)
# boost_test(TYPE run SOURCES boost_units_support_test.cpp # boost_test(TYPE run SOURCES boost_units_support_test.cpp
# LIBRARIES Boost::histogram Boost::core Boost::units) # 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 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 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) # boost_test(TYPE run SOURCES histogram_serialization_test.cpp LIBRARIES Boost::histogram Boost::core Boost::serialization)

View File

@ -12,6 +12,10 @@ import regex ;
import testing ; import testing ;
import ../../config/checks/config : requires ; import ../../config/checks/config : requires ;
if ! [ python.configured ]
{
using python ;
}
path-constant THIS_PATH : . ; path-constant THIS_PATH : . ;
@ -23,10 +27,13 @@ project
] ]
; ;
# Check consistency of build systems
testing.make-test run-pyd : check_build_system.py :
<dependency>Jamfile <dependency>CMakeLists.txt ;
# Verify One Definition Rule by linking two object files which include everything # 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 : <dependency>odr_test.cpp ;
alias odr : alias odr :
check_odr_test
[ link odr_main_test.cpp odr_test.cpp ] [ link odr_main_test.cpp odr_test.cpp ]
; ;