]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/pfr/test/Jamfile.v2
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / pfr / test / Jamfile.v2
1 # Copyright (C) 2016-2020, Antony Polukhin.
2 #
3 # Use, modification and distribution is subject to the Boost Software License,
4 # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 # http://www.boost.org/LICENSE_1_0.txt)
6 #
7
8 import python ;
9 import testing ;
10 import ../../config/checks/config : requires ;
11
12 project
13 : source-location .
14 : requirements
15 <toolset>msvc:<cxxflags>"/std:c++latest"
16 <define>BOOST_PFR_DETAIL_STRICT_RVALUE_TESTING=1
17 [ requires cxx14_constexpr ]
18 ;
19
20 ########## BEGIN of helpers to detect Loophole trick support
21
22 actions mp_simple_run_action
23 {
24 $(>) > $(<)
25 }
26
27 rule mp-run-simple ( sources + : args * : input-files * : requirements * : target-name )
28 {
29 exe $(target-name)_exe : $(sources) : $(requirements) ;
30 explicit $(target-name)_exe ;
31 make $(target-name).output : $(target-name)_exe : @mp_simple_run_action ;
32 explicit $(target-name).output ;
33 alias $(target-name) : $(target-name).output ;
34 }
35
36 mp-run-simple loophole_detection.cpp : : : : compiler_supports_loophole ;
37 explicit compiler_supports_loophole ;
38
39 ########## END of helpers to detect Loophole trick support
40
41
42 local DISABLE_ON_MSVC = <toolset>msvc:<build>no ;
43 local REQUIRE_LOOPHOLE =
44 [ check-target-builds ../test//compiler_supports_loophole : : <build>no ]
45 ;
46
47 local STRUCTURED_BINDING_ENGINE = <define>BOOST_PFR_USE_LOOPHOLE=0 <define>BOOST_PFR_USE_CPP17=1 [ requires cxx17_structured_bindings ] ;
48 local LOOPHOLE_ENGINE = <define>BOOST_PFR_USE_LOOPHOLE=1 <define>BOOST_PFR_USE_CPP17=0 $(REQUIRE_LOOPHOLE) ;
49 local CLASSIC_ENGINE = <define>BOOST_PFR_USE_LOOPHOLE=0 <define>BOOST_PFR_USE_CPP17=0 $(DISABLE_ON_MSVC) ;
50
51 test-suite pfr_tests
52 :
53 [ run print_config.cpp : : : <test-info>always_show_run_output : auto_engine_config ]
54
55 [ run offset_based_getter.cpp ]
56
57 [ run test_tuple_sizes_on.cpp : : : <define>BOOST_PFR_RUN_TEST_ON=char : test_tuple_sizes_on_chars ]
58 [ run test_tuple_sizes_on.cpp : : : <define>BOOST_PFR_RUN_TEST_ON=int : test_tuple_sizes_on_ints ]
59 [ run test_tuple_sizes_on.cpp : : : <define>BOOST_PFR_RUN_TEST_ON=short : test_tuple_sizes_on_shorts ]
60 [ run test_tuple_sizes_on.cpp : : : <define>BOOST_PFR_RUN_TEST_ON=void* : test_tuple_sizes_on_voidptrs ]
61 [ run test_tuple_sizes_on.cpp : : : <define>BOOST_PFR_RUN_TEST_ON="std::size_t" : test_tuple_sizes_on_size_ts ]
62
63 [ run run/motivating_example.cpp : : : : auto_engine_motivating ]
64 [ run ../example/sample_printing.cpp : : : : auto_engine_sample_printing ]
65 [ run ../example/get.cpp : : : : auto_engine_get ]
66 [ run ../example/quick_examples.cpp : : : : auto_engine_quick ]
67 ;
68
69 local BLACKLIST_TESTS_FOR_LOOPHOLE =
70 get_const_field # boost::pfr::get gives compile time error on const fields
71 template_constructor # Template constructor in one of the fields of the aggregate
72 tie_anonymous_const_field # boost::pfr::structure_tie gives compile time error on const fields
73 ;
74
75 # Those tests are either
76 # * reflecting a non literal type
77 # * or calling boost::pfr::get and the result is a user defined structure
78 local BLACKLIST_TESTS_FOR_CLASSIC =
79 get_const_field
80 get_non_default_constructible
81 get_rvalue
82 issue30
83 issue33
84 motivating_example0
85 motivating_example2
86 optional_like
87 read_write_non_literal
88 template_constructor
89 template_forwarding_ref
90 template_unconstrained
91 tie_anonymous
92 tie_anonymous_const_field
93 ;
94
95 for local source_file in [ glob ./run/*.cpp ] [ glob ../example/*.cpp ]
96 {
97 local target_name = $(source_file[1]:B) ;
98 pfr_tests += [ run $(source_file) : : : $(STRUCTURED_BINDING_ENGINE) : $(target_name)_sb ] ;
99
100 if ! $(target_name) in $(BLACKLIST_TESTS_FOR_LOOPHOLE)
101 {
102 pfr_tests += [ run $(source_file) : : : $(LOOPHOLE_ENGINE) : $(target_name)_lh ] ;
103 }
104 else
105 {
106 pfr_tests += [ compile-fail $(source_file) : $(LOOPHOLE_ENGINE) : $(target_name)_lh ] ;
107 }
108
109 if ! $(target_name) in $(BLACKLIST_TESTS_FOR_CLASSIC)
110 {
111 pfr_tests += [ run $(source_file) : : : $(CLASSIC_ENGINE) : $(target_name)_classic ] ;
112 }
113 else
114 {
115 pfr_tests += [ compile-fail $(source_file) : $(CLASSIC_ENGINE) : $(target_name)_classic ] ;
116 }
117 }
118
119 for local source_file in [ glob ./compile-fail/*.cpp ]
120 {
121 local target_name = $(source_file[1]:B) ;
122 pfr_tests += [ compile-fail $(source_file) : $(STRUCTURED_BINDING_ENGINE) : $(target_name)_sb ] ;
123 pfr_tests += [ compile-fail $(source_file) : $(LOOPHOLE_ENGINE) : $(target_name)_lh ] ;
124 pfr_tests += [ compile-fail $(source_file) : $(CLASSIC_ENGINE) : $(target_name)_classic ] ;
125 }
126
127 if [ python.configured ]
128 {
129 testing.make-test run-pyd : ../misc/generate_cpp17.py ;
130 }