1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
# Copyright 2023-2025 Andrey Semashev
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# https://www.boost.org/LICENSE_1_0.txt)
require-b2 5.0.1 ;
import testing ;
import path ;
import regex ;
import os ;
import-search /boost/config/checks ;
import config : requires ;
project
: requirements
<library>/boost/scope//boost_scope
<include>common
<c++-template-depth>1024
[ requires
exceptions
cxx11_nullptr
cxx11_lambdas
cxx11_decltype
cxx11_noexcept
cxx11_constexpr
cxx11_template_aliases
cxx11_rvalue_references
cxx11_auto_declarations
cxx11_unified_initialization_syntax
cxx11_defaulted_functions
cxx11_deleted_functions
cxx11_hdr_system_error
]
<target-os>windows:<define>_CRT_SECURE_NO_WARNINGS
<target-os>windows:<define>_CRT_SECURE_NO_DEPRECATE
;
path-constant SCOPE_INCLUDE_DIR : ../include ;
# 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 ;
if ! [ os.environ BOOST_SCOPE_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ]
{
local headers_path = [ path.make $(SCOPE_INCLUDE_DIR)/boost/scope ] ;
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 ~hdr/$(rel_file) "/" "-" ] ;
#ECHO $(rel_file) ;
all_rules += [ compile compile/self_contained_header.cpp : <define>"BOOST_SCOPE_TEST_HEADER=$(rel_file)" <dependency>$(file) : $(test_name) ] ;
}
}
for file in [ glob compile/*.cpp ]
{
if [ path.basename $(file) ] != "self_contained_header.cpp"
{
all_rules += [ compile $(file) ] ;
}
}
for file in [ glob compile_fail/*.cpp ]
{
all_rules += [ compile-fail $(file) ] ;
}
for file in [ glob run/*.cpp ]
{
all_rules += [ run $(file) : : :
<warnings>extra
<toolset>msvc:<warnings-as-errors>on
<toolset>clang:<warnings-as-errors>on
<toolset>gcc:<warnings-as-errors>on
] ;
}
#ECHO All rules: $(all_rules) ;
return $(all_rules) ;
}
test-suite scope : [ test_all ] ;
|