# # Copyright Andrey Semashev 2015. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import testing ; import path ; import regex ; project : requirements # Disable warnings about using 'insecure' standard C functions msvc:_SCL_SECURE_NO_WARNINGS msvc:_SCL_SECURE_NO_DEPRECATE msvc:_CRT_SECURE_NO_WARNINGS msvc:_CRT_SECURE_NO_DEPRECATE intel-win:_SCL_SECURE_NO_WARNINGS intel-win:_SCL_SECURE_NO_DEPRECATE intel-win:_CRT_SECURE_NO_WARNINGS intel-win:_CRT_SECURE_NO_DEPRECATE : default-build # Testers typically don't specify threading environment and the library can be built and tested for single and multi. I'm more interested in multi though. multi # static ; # this rule enumerates through all the sources and invokes # the run rule for each source, the result is a list of all # the run rules, which we can pass on to the test_suite rule: rule test_all { local all_rules = ; local file ; local headers_path = [ path.make $(BOOST_ROOT)/libs/winapi/include/boost/detail ] ; for file in [ path.glob-tree $(headers_path) : *.hpp : detail ] { local rel_file = [ path.relative-to $(headers_path) $(file) ] ; # Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end. # All '/' are replaced with '-' because apparently test scripts have a problem with test names containing slashes. local test_name = [ regex.replace $(rel_file) "/" "-" ] ; local decl_test_name = ~hdr-decl-$(test_name) ; local use_winh_test_name = ~hdr-use-winh-$(test_name) ; local pre_winh_test_name = ~hdr-pre-winh-$(test_name) ; local post_winh_test_name = ~hdr-post-winh-$(test_name) ; #ECHO $(rel_file) ; all_rules += [ compile compile/decl_header.cpp : "BOOST_WINAPI_TEST_HEADER=$(rel_file)" $(file) : $(decl_test_name) ] ; all_rules += [ compile compile/decl_header.cpp : "BOOST_WINAPI_TEST_HEADER=$(rel_file)" "BOOST_USE_WINDOWS_H" $(file) : $(use_winh_test_name) ] ; all_rules += [ compile compile/windows_h_pre.cpp : "BOOST_WINAPI_TEST_HEADER=$(rel_file)" $(file) : $(pre_winh_test_name) ] ; all_rules += [ compile compile/windows_h_post.cpp : "BOOST_WINAPI_TEST_HEADER=$(rel_file)" $(file) : $(post_winh_test_name) ] ; } for file in [ glob run/*.cpp ] { all_rules += [ run $(file) : : : always_show_run_output ] ; } #ECHO All rules: $(all_rules) ; return $(all_rules) ; } test-suite winapi : [ test_all r ] ;