Imported Upstream version 1.71.0
[platform/upstream/boost.git] / libs / gil / test / headers / Jamfile
1 # Boost.GIL (Generic Image Library) - tests
2 #
3 # Copyright (c) 2018 Mateusz Loskot <mateusz@loskot.net>
4 # Copyright (c) 2018 Dmitry Arkhipov
5 #
6 # Distributed under the Boost Software License, Version 1.0.
7 # (See accompanying file LICENSE_1_0.txt or
8 # copy at http://www.boost.org/LICENSE_1_0.txt)
9
10 import os ;
11 import path ;
12 import regex ;
13
14 rule generate_self_contained_headers ( headers_subpath * : exclude_subpaths * )
15 {
16     # On CI services, test the self-contained headers on-demand only to avoid build timeouts
17     # CI environment is common for Travis CI, AppVeyor, CircleCI, etc.
18     # For example:
19     # if ! [ os.environ CI ] || [ os.environ TEST_HEADERS ] {
20     #    alias self_contained_headers : [ generate_self_contained_headers ] ;
21     # }
22
23     local targets ;
24
25     # NOTE: All '/' in test names are replaced with '-' because apparently
26     #       test scripts have a problem with test names containing slashes.
27
28     local top_headers_path = [ path.make $(BOOST_ROOT)/libs/gil/include/boost/gil ] ;
29
30     for local file in [ path.glob-tree $(top_headers_path)/$(headers_subpath) : *.hpp : $(exclude_subpaths) ]
31     {
32         local rel_file = [ path.relative-to $(top_headers_path) $(file) ] ;
33         local target_name = [ regex.replace h/$(rel_file) "/" "-" ] ;
34         local target_name = [ regex.replace $(target_name) "\.hpp" "" ] ;
35         targets += [
36             compile $(BOOST_ROOT)/libs/gil/test/headers/main.cpp
37             : <define>"BOOST_GIL_TEST_HEADER=$(rel_file)" <dependency>$(file)
38             : $(target_name)
39         ] ;
40     }
41
42     return $(targets) ;
43 }
44
45 # TODO: Review sorting to get as close as possible from general to specific
46
47 # Core
48 alias concepts : [ generate_self_contained_headers concepts ] ;
49 alias core : [ generate_self_contained_headers : concepts extension io ] ;
50 alias io : [ generate_self_contained_headers io : concepts extension ] ;
51
52 # Extensions
53 alias extension/dynamic_image : [ generate_self_contained_headers extension/dynamic_image ] ;
54 alias extension/io : [ generate_self_contained_headers extension/io ] ;
55 alias extension/numeric : [ generate_self_contained_headers extension/numeric ] ;
56 alias extension/toolbox : [ generate_self_contained_headers extension/toolbox ] ;