]>
Commit | Line | Data |
---|---|---|
92f5a8d4 TL |
1 | # Copyright Hans Dembinski 2019 |
2 | # Distributed under the Boost Software License, Version 1.0. | |
3 | # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt | |
4 | ||
f67539c2 TL |
5 | find_package(PythonInterp) |
6 | if (PYTHONINTERP_FOUND) | |
7 | # checks that b2 and cmake are in sync | |
8 | add_test(NAME runpy-${PROJECT_NAME}_check_build_system COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/check_build_system.py) | |
92f5a8d4 | 9 | |
f67539c2 TL |
10 | # checks that all headers are included in odr test |
11 | add_test(NAME runpy-${PROJECT_NAME}_check_odr_test COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/check_odr_test.py) | |
12 | endif() | |
13 | ||
14 | include(BoostTest OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST) | |
15 | if(NOT HAVE_BOOST_TEST) | |
16 | return() | |
17 | endif() | |
92f5a8d4 | 18 | |
f67539c2 | 19 | set(BOOST_TEST_LINK_LIBRARIES Boost::histogram) |
92f5a8d4 TL |
20 | |
21 | # keep in sync with Jamfile, this should be automatized... | |
f67539c2 TL |
22 | boost_test(TYPE compile-fail SOURCES axis_category_fail0.cpp) |
23 | boost_test(TYPE compile-fail SOURCES axis_category_fail1.cpp) | |
24 | boost_test(TYPE compile-fail SOURCES axis_category_fail2.cpp) | |
25 | boost_test(TYPE compile-fail SOURCES axis_integer_fail0.cpp) | |
26 | boost_test(TYPE compile-fail SOURCES axis_integer_fail1.cpp) | |
27 | boost_test(TYPE compile-fail SOURCES axis_integer_fail2.cpp) | |
28 | boost_test(TYPE compile-fail SOURCES axis_integer_fail3.cpp) | |
29 | boost_test(TYPE compile-fail SOURCES axis_integer_fail4.cpp) | |
30 | boost_test(TYPE compile-fail SOURCES axis_regular_fail0.cpp) | |
31 | boost_test(TYPE compile-fail SOURCES axis_regular_fail1.cpp) | |
32 | boost_test(TYPE compile-fail SOURCES axis_variable_fail0.cpp) | |
33 | boost_test(TYPE compile-fail SOURCES axis_variable_fail1.cpp) | |
34 | boost_test(TYPE compile-fail SOURCES make_histogram_fail0.cpp) | |
35 | boost_test(TYPE compile-fail SOURCES make_histogram_fail1.cpp) | |
36 | boost_test(TYPE compile-fail SOURCES histogram_fail0.cpp) | |
37 | boost_test(TYPE compile-fail SOURCES histogram_fail1.cpp) | |
38 | boost_test(TYPE compile-fail SOURCES histogram_fail2.cpp) | |
39 | boost_test(TYPE compile-fail SOURCES histogram_fail3.cpp) | |
40 | boost_test(TYPE compile-fail SOURCES histogram_fail4.cpp) | |
92f5a8d4 | 41 | |
f67539c2 | 42 | set(BOOST_TEST_LINK_LIBRARIES Boost::histogram Boost::core) |
92f5a8d4 | 43 | |
f67539c2 TL |
44 | boost_test(TYPE run SOURCES accumulators_count_test.cpp) |
45 | boost_test(TYPE run SOURCES accumulators_mean_test.cpp) | |
46 | boost_test(TYPE run SOURCES accumulators_sum_test.cpp) | |
47 | boost_test(TYPE run SOURCES accumulators_thread_safe_test.cpp) | |
48 | boost_test(TYPE run SOURCES accumulators_weighted_mean_test.cpp) | |
49 | boost_test(TYPE run SOURCES accumulators_weighted_sum_test.cpp) | |
50 | boost_test(TYPE run SOURCES algorithm_project_test.cpp) | |
51 | boost_test(TYPE run SOURCES algorithm_reduce_test.cpp) | |
52 | boost_test(TYPE run SOURCES algorithm_sum_test.cpp) | |
53 | boost_test(TYPE run SOURCES algorithm_empty_test.cpp) | |
20effc67 | 54 | boost_test(TYPE run SOURCES axis_boolean_test.cpp) |
f67539c2 TL |
55 | boost_test(TYPE run SOURCES axis_category_test.cpp) |
56 | boost_test(TYPE run SOURCES axis_integer_test.cpp) | |
57 | boost_test(TYPE run SOURCES axis_option_test.cpp) | |
58 | boost_test(TYPE run SOURCES axis_regular_test.cpp) | |
f67539c2 TL |
59 | boost_test(TYPE run SOURCES axis_traits_test.cpp) |
60 | boost_test(TYPE run SOURCES axis_variable_test.cpp) | |
61 | boost_test(TYPE run SOURCES axis_variant_test.cpp) | |
62 | boost_test(TYPE run SOURCES detail_accumulator_traits_test.cpp) | |
63 | boost_test(TYPE run SOURCES detail_argument_traits_test.cpp) | |
64 | boost_test(TYPE run SOURCES detail_args_type_test.cpp) | |
65 | boost_test(TYPE run SOURCES detail_axes_test.cpp) | |
66 | boost_test(TYPE run SOURCES detail_convert_integer_test.cpp) | |
67 | boost_test(TYPE run SOURCES detail_detect_test.cpp) | |
68 | boost_test(TYPE run SOURCES detail_limits_test.cpp) | |
69 | boost_test(TYPE run SOURCES detail_make_default_test.cpp) | |
70 | boost_test(TYPE run SOURCES detail_misc_test.cpp) | |
71 | boost_test(TYPE run SOURCES detail_large_int_test.cpp) | |
72 | boost_test(TYPE run SOURCES detail_iterator_adaptor_test.cpp) | |
73 | boost_test(TYPE run SOURCES detail_operators_test.cpp) | |
74 | boost_test(TYPE run SOURCES detail_relaxed_equal_test.cpp) | |
75 | boost_test(TYPE run SOURCES detail_replace_type_test.cpp) | |
76 | boost_test(TYPE run SOURCES detail_safe_comparison_test.cpp) | |
77 | boost_test(TYPE run SOURCES detail_static_if_test.cpp) | |
78 | boost_test(TYPE run SOURCES detail_tuple_slice_test.cpp) | |
79 | boost_test(TYPE run SOURCES histogram_custom_axis_test.cpp) | |
80 | boost_test(TYPE run SOURCES histogram_dynamic_test.cpp) | |
81 | boost_test(TYPE run SOURCES histogram_fill_test.cpp | |
82 | COMPILE_OPTIONS $<$<CXX_COMPILER_ID:MSVC>:/bigobj>) | |
83 | boost_test(TYPE run SOURCES histogram_growing_test.cpp) | |
84 | boost_test(TYPE run SOURCES histogram_mixed_test.cpp) | |
20effc67 TL |
85 | boost_test(TYPE run SOURCES histogram_operators_test.cpp |
86 | COMPILE_OPTIONS $<$<CXX_COMPILER_ID:MSVC>:/bigobj>) | |
f67539c2 TL |
87 | boost_test(TYPE run SOURCES histogram_ostream_test.cpp) |
88 | boost_test(TYPE run SOURCES histogram_test.cpp) | |
89 | boost_test(TYPE run SOURCES indexed_test.cpp) | |
90 | boost_test(TYPE run SOURCES storage_adaptor_test.cpp) | |
91 | boost_test(TYPE run SOURCES unlimited_storage_test.cpp) | |
92 | boost_test(TYPE run SOURCES utility_test.cpp) | |
93 | ||
94 | find_package(Threads) | |
92f5a8d4 | 95 | if (Threads_FOUND) |
f67539c2 | 96 | |
92f5a8d4 | 97 | boost_test(TYPE run SOURCES histogram_threaded_test.cpp |
f67539c2 | 98 | LINK_LIBRARIES Threads::Threads) |
92f5a8d4 | 99 | boost_test(TYPE run SOURCES storage_adaptor_threaded_test.cpp |
f67539c2 TL |
100 | LINK_LIBRARIES Threads::Threads) |
101 | ||
92f5a8d4 TL |
102 | endif() |
103 | ||
104 | ## No cmake support yet | |
105 | # boost_test(TYPE link SOURCES odr_main_test.cpp odr_test.cpp | |
f67539c2 | 106 | # LINK_LIBRARIES Boost::serialization) |
92f5a8d4 | 107 | # boost_test(TYPE run SOURCES boost_accumulators_support_test.cpp |
f67539c2 | 108 | # LINK_LIBRARIES Boost::accumulators) |
92f5a8d4 | 109 | # boost_test(TYPE run SOURCES boost_range_support_test.cpp |
f67539c2 | 110 | # LINK_LIBRARIES Boost::range) |
92f5a8d4 | 111 | # boost_test(TYPE run SOURCES boost_units_support_test.cpp |
f67539c2 TL |
112 | # LINK_LIBRARIES Boost::units) |
113 | # boost_test(TYPE run SOURCES detail_array_wrapper_serialization_test.cpp LINK_LIBRARIES Boost::serialization) | |
114 | # boost_test(TYPE run SOURCES unlimited_storage_serialization_test.cpp LINK_LIBRARIES Boost::serialization) | |
115 | # boost_test(TYPE run SOURCES storage_adaptor_serialization_test.cpp LINK_LIBRARIES Boost::serialization) | |
116 | # boost_test(TYPE run SOURCES histogram_serialization_test.cpp LINK_LIBRARIES Boost::serialization) | |
92f5a8d4 | 117 | # boost_test(TYPE run SOURCES axis_variant_serialization_test.cpp |
f67539c2 | 118 | # LINK_LIBRARIES Boost::serialization) |
92f5a8d4 | 119 | # boost_test(TYPE run SOURCES accumulators_serialization_test.cpp |
f67539c2 TL |
120 | # LINK_LIBRARIES Boost::serialization) |
121 | ||
20effc67 TL |
122 | # Workaround for gcc-5 |
123 | if (NOT(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6)) | |
124 | ||
125 | boost_test(TYPE run SOURCES deduction_guides_test.cpp | |
126 | COMPILE_FEATURES cxx_std_17 | |
127 | ) | |
128 | boost_test(TYPE run SOURCES issue_290_test.cpp | |
129 | COMPILE_FEATURES cxx_std_17 | |
130 | ) | |
131 | ||
132 | endif() |