1 # (C) Copyright Gennadiy Rozental 2001-2015.
2 # Use, modification, and distribution are subject to the
3 # Boost Software License, Version 1.0. (See accompanying file
4 # LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 # See http://www.boost.org/libs/test for the library home page.
10 import ../../config/checks/config : requires ;
16 local check_msg = "Boost.Test feature check: " ;
18 # documentation requirements: we use new style examples in the doc and compile on compilers supporting that
19 requirements_documentation = [ requires cxx11_decltype cxx11_hdr_random cxx11_hdr_tuple cxx11_hdr_initializer_list cxx11_variadic_macros cxx11_template_aliases ] ;
21 # requirements for BOOST_TEST feature, full extension
22 requirements_boost_test_full_support = [ requires cxx11_variadic_macros cxx11_decltype cxx11_auto_declarations ] ;
23 # requirements_boost_test_full_support += [ check-target-builds ../tools/check_boost_test_support.cpp "Boost.Test feature check: BOOST_TEST full support" : : <build>no ] ;
25 # requirements for dataset feature
26 requirements_datasets = [ requires cxx11_decltype cxx11_hdr_random cxx11_hdr_tuple cxx11_hdr_initializer_list cxx11_variadic_macros cxx11_trailing_result_types cxx11_template_aliases ] ;
29 #_________________________________________________________________________________________________#
31 # lib gcov : : <name>gcov : ;
33 rule boost.test-self-test ( test-rule : test-suite : test-name : usage-variant ? : pattern_file * : source_files * : extra-libs ? : extra-options ? : requirements * )
35 source_files ?= $(test-suite)/$(test-name).cpp ;
36 usage-variant ?= boost_unit_test_framework/<link>static ;
38 return [ $(test-rule) $(source_files) ../build//$(usage-variant) $(extra-libs)
42 : # Activating -pedantic finds more gotchas
43 # Unfortunately, this warns about the use of "long long" in gcc's own stdlib
44 # So deactivate those warnings again
45 <toolset>gcc:<cxxflags>-pedantic
46 <toolset>gcc:<cxxflags>-Wno-long-long
47 <toolset>gcc:<cxxflags>-Wno-variadic-macros
48 <toolset>clang:<cxxflags>-Wno-c99-extensions
49 <toolset>clang:<cxxflags>-Wno-variadic-macros
50 # <toolset>gcc:<cxxflags>--coverage
58 #_________________________________________________________________________________________________#
60 rule boost.test-mt-test ( test-rule : test-suite : test-name : usage-variant ? : pattern_file * : source_files * : extra-libs ? )
62 return [ boost.test-self-test $(test-rule)
73 #_________________________________________________________________________________________________#
75 rule docs-example-as-test ( test-file )
77 test-file-name = [ path.basename $(test-file) ] ;
78 test-name-rule = [ MATCH (.+)\\.(.+)\\.cpp : $(test-file-name) ] ;
81 return [ boost.test-self-test $(test-name-rule[2])
83 : doc-$(test-name-rule[1])
89 : $(requirements_documentation) # requirements
93 #_________________________________________________________________________________________________#
97 [ boost.test-self-test run : utils-ts : algorithm-test ]
98 [ boost.test-self-test run : utils-ts : basic_cstring-test ]
99 [ boost.test-self-test run : utils-ts : class_properties-test ]
100 [ boost.test-self-test run : utils-ts : foreach-test ]
101 [ boost.test-self-test run : utils-ts : named_params-test ]
102 [ boost.test-self-test run : utils-ts : runtime-param-test : : : : : : [ requires cxx11_auto_declarations cxx11_function_template_default_args cxx11_lambdas cxx11_hdr_initializer_list cxx11_template_aliases ] ]
103 [ boost.test-self-test run : utils-ts : string_cast-test ]
104 [ boost.test-self-test run : utils-ts : token_iterator-test ]
107 #_________________________________________________________________________________________________#
109 test-suite "usage-variants-ts"
111 [ boost.test-self-test run : usage-variants-ts : single-header-test : included ]
112 [ boost.test-self-test run : usage-variants-ts : single-header-custom-init-test : included ]
113 [ boost.test-self-test run : usage-variants-ts : single-header-custom-main-test : included ]
115 [ boost.test-self-test run : usage-variants-ts : static-library-test ]
116 [ boost.test-self-test run : usage-variants-ts : static-library-custom-init-test ]
118 [ boost.test-self-test run : usage-variants-ts : shared-library-test : boost_unit_test_framework/<link>shared ]
119 [ boost.test-self-test run : usage-variants-ts : shared-library-custom-init-test : boost_unit_test_framework/<link>shared ]
120 [ boost.test-self-test run : usage-variants-ts : shared-library-custom-main-test : boost_unit_test_framework/<link>shared ]
123 #_________________________________________________________________________________________________#
125 test-suite "framework-ts"
127 [ boost.test-self-test run : framework-ts : result-report-test : : baseline-outputs/result-report-test.pattern ]
128 [ boost.test-self-test run : framework-ts : log-formatter-test : : baseline-outputs/log-formatter-test.pattern ]
129 [ boost.test-self-test run : framework-ts : run-by-name-or-label-test ]
132 #_________________________________________________________________________________________________#
134 test-suite "writing-test-ts"
136 [ boost.test-self-test run : writing-test-ts : assertion-construction-test : : : : : : $(requirements_boost_test_full_support) [ requires cxx11_trailing_result_types cxx11_nullptr ] ]
137 [ boost.test-self-test run : writing-test-ts : boost_check_equal-str-test ]
138 [ boost.test-self-test run : writing-test-ts : collection-comparison-test : : : : : : $(requirements_boost_test_full_support) [ requires cxx11_unified_initialization_syntax ] ] # required by the test content
139 [ boost.test-self-test run : writing-test-ts : dont_print_log_value-test : : : : : : $(requirements_datasets) ]
140 [ boost.test-self-test run : writing-test-ts : fp-comparisons-test : : : : : : $(requirements_boost_test_full_support) ]
141 [ boost.test-self-test run : writing-test-ts : fp-multiprecision-comparison-test : : : : : : $(requirements_boost_test_full_support) ]
142 [ boost.test-self-test run : writing-test-ts : output_test_stream-test ]
143 [ boost.test-self-test run : writing-test-ts : test_tools-test : : baseline-outputs/test_tools-test.pattern : : : : $(requirements_boost_test_full_support) ]
144 [ boost.test-self-test run : writing-test-ts : windows-headers-test ]
145 [ boost.test-self-test run : writing-test-ts : tools-under-debugger-test ]
146 [ boost.test-self-test run : writing-test-ts : tools-debuggable-test : : : : : : $(requirements_boost_test_full_support) ]
147 [ boost.test-self-test run : writing-test-ts : test-dataset-over-tuples : : : : : : $(requirements_datasets) ]
150 #_________________________________________________________________________________________________#
152 test-suite "test-organization-ts"
154 [ boost.test-self-test run : test-organization-ts : parameterized_test-test ]
155 [ boost.test-self-test run : test-organization-ts : test_case_template-test ]
156 [ boost.test-self-test run : test-organization-ts : datasets-test : : : [ glob test-organization-ts/datasets-test/*.cpp ] : : : $(requirements_datasets) ]
157 [ boost.test-self-test run : test-organization-ts : dataset-variadic_and_move_semantic-test : : : : : : $(requirements_datasets) ]
158 [ boost.test-self-test run : test-organization-ts : test_unit-order-test ]
159 [ boost.test-self-test run : test-organization-ts : test_unit-order-shuffled-test : : : : : : $(requirements_boost_test_full_support) ]
160 [ boost.test-self-test run : test-organization-ts : test-tree-management-test ]
163 #_________________________________________________________________________________________________#
165 test-suite "multithreading-ts"
167 [ boost.test-mt-test run : multithreading-ts : sync-access-test : : : : /boost/thread//boost_thread/<link>static ]
170 #_________________________________________________________________________________________________#
172 test-suite "prg_exec_monitor-ts"
174 [ boost.test-self-test run-fail : prg_exec_monitor-ts : result-code-test : boost_prg_exec_monitor/<link>static ]
175 [ boost.test-self-test run-fail : prg_exec_monitor-ts : system-exception-test : boost_prg_exec_monitor/<link>static ]
176 [ boost.test-self-test run-fail : prg_exec_monitor-ts : uncatched-exception-test : included ]
177 [ boost.test-self-test run-fail : prg_exec_monitor-ts : user-fatal-exception-test : boost_prg_exec_monitor/<link>static ]
180 #_________________________________________________________________________________________________#
182 test-suite "execution_monitor-ts"
184 [ boost.test-self-test run : execution_monitor-ts : errors-handling-test : : baseline-outputs/errors-handling-test.pattern
185 baseline-outputs/errors-handling-test.pattern2 ]
186 [ boost.test-self-test run : execution_monitor-ts : custom-exception-test ]
189 #_________________________________________________________________________________________________#
193 test-suite "doc-examples-ts"
195 [ sequence.transform docs-example-as-test : [ glob ../doc/examples/*.cpp ] ]
198 #_________________________________________________________________________________________________#
200 # A target that runs all the tests
214 #_________________________________________________________________________________________________#