Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / gil / test / Jamfile
1 # Boost.GIL (Generic Image Library) - tests
2 #
3 # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
4 # Copyright (c) 2018-2019 Mateusz Loskot <mateusz@loskot.net>
5 # Copyright (c) 2018 Dmitry Arkhipov
6 # Copyright (c) 2007-2015 Andrey Semashev
7 #
8 # Use, modification and distribution is subject to the Boost Software License,
9 # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
10 # http://www.boost.org/LICENSE_1_0.txt)
11
12 import ../../config/checks/config : requires ;
13 import os ;
14 import path ;
15 import regex ;
16 import testing ;
17
18 # Avoid warnings flood on Travis CI, AppVeyor, CircleCI, Azure Pipelines
19 if ! [ os.environ CI ] && ! [ os.environ AGENT_JOBSTATUS ]
20 {
21     DEVELOPMENT_EXTRA_WARNINGS =
22       <toolset>msvc:<cxxflags>/W4
23       <toolset>gcc:<cxxflags>"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter"
24       <toolset>clang,<variant>debug:<cxxflags>"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter -Wsign-conversion"
25       <toolset>clang,<variant>release:<cxxflags>"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter -Wsign-conversion"
26       <toolset>darwin:<cxxflags>"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter"
27       ;
28 }
29
30 project
31   :
32   requirements
33     <include>.
34     # TODO: Enable concepts check for all, not just test/core
35     #<define>BOOST_GIL_USE_CONCEPT_CHECK=1
36     <toolset>msvc:<asynch-exceptions>on
37     <toolset>msvc:<cxxflags>/bigobj
38     <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
39     <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
40     <toolset>msvc:<define>_CRT_NONSTDC_NO_DEPRECATE
41     <toolset>msvc:<define>NOMINMAX
42     <toolset>intel:<debug-symbols>off
43     <toolset>gcc:<cxxflags>"-fstrict-aliasing"
44     <toolset>darwin:<cxxflags>"-fstrict-aliasing"
45     # variant filter for clang is necessary to allow ubsan_*
46     # custom variants declare distinct set of <cxxflags>
47     <toolset>clang,<variant>debug:<cxxflags>"-fstrict-aliasing"
48     <toolset>clang,<variant>release:<cxxflags>"-fstrict-aliasing"
49     $(DEVELOPMENT_EXTRA_WARNINGS)
50     [ requires
51         cxx11_constexpr
52         cxx11_defaulted_functions
53         cxx11_template_aliases
54         cxx11_trailing_result_types  # implies decltype and auto
55         cxx11_variadic_templates
56     ]
57   ;
58
59 variant gil_ubsan_integer
60     : release
61     :
62     <cxxflags>"-Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=integer -fno-sanitize-recover=integer -fsanitize-blacklist=libs/gil/.ci/blacklist.supp"
63     <linkflags>"-fsanitize=integer"
64     <debug-symbols>on
65     <define>BOOST_USE_ASAN=1
66     ;
67
68 variant gil_ubsan_nullability
69     : release
70     :
71     <cxxflags>"-Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=nullability -fno-sanitize-recover=nullability -fsanitize-blacklist=libs/gil/.ci/blacklist.supp"
72     <linkflags>"-fsanitize=nullability"
73     <debug-symbols>on
74     <define>BOOST_USE_ASAN=1
75     ;
76
77 variant gil_ubsan_undefined
78     : release
79     :
80     <cxxflags>"-Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=undefined -fsanitize-blacklist=libs/gil/.ci/blacklist.supp"
81     <linkflags>"-fsanitize=undefined"
82     <debug-symbols>on
83     <define>BOOST_USE_ASAN=1
84     ;
85
86 rule generate_self_contained_headers ( headers_subpath * : exclude_subpaths * )
87 {
88     # On CI services, test the self-contained headers on-demand only to avoid build timeouts
89     # CI environment is common for Travis CI, AppVeyor, CircleCI, etc.
90     # For example:
91     # if ! [ os.environ CI ] || [ os.environ TEST_HEADERS ] {
92     #    alias self_contained_headers : [ generate_self_contained_headers ] ;
93     # }
94
95     local targets ;
96
97     # NOTE: All '/' in test names are replaced with '-' because apparently
98     #       test scripts have a problem with test names containing slashes.
99
100     local top_headers_path = [ path.make $(BOOST_ROOT)/libs/gil/include/boost/gil ] ;
101
102     for local file in [ path.glob-tree $(top_headers_path)/$(headers_subpath) : *.hpp : $(exclude_subpaths) ]
103     {
104         local rel_file = [ path.relative-to $(top_headers_path) $(file) ] ;
105         local target_name = [ regex.replace h/$(rel_file) "/" "-" ] ;
106         local target_name = [ regex.replace $(target_name) "\.hpp" "" ] ;
107         targets += [
108             compile $(BOOST_ROOT)/libs/gil/test/header/main.cpp
109             : <define>"BOOST_GIL_TEST_HEADER=$(rel_file)" <dependency>$(file)
110             : $(target_name)
111         ] ;
112     }
113
114     return $(targets) ;
115 }
116
117 build-project core ;
118 build-project legacy ;
119 build-project extension ;