summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/log/test/Jamfile.v2
blob: 11246932306a3e542a1c1014d082c9f8a5bee194 (plain)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#
#          Copyright Andrey Semashev 2007 - 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)
#
# The file was adapted from libs/tr2/test/Jamfile.v2 by John Maddock.

import testing ;
import path ;
import regex ;
import os ;
import ../build/log-platform-config ;

project
    : requirements
        <conditional>@log-platform-config.set-platform-defines

        <include>common

        # Disable warnings about using 'insecure' standard C functions
        <toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
        <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
        <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
        <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
        <toolset>intel-win:<define>_SCL_SECURE_NO_WARNINGS
        <toolset>intel-win:<define>_SCL_SECURE_NO_DEPRECATE
        <toolset>intel-win:<define>_CRT_SECURE_NO_WARNINGS
        <toolset>intel-win:<define>_CRT_SECURE_NO_DEPRECATE

        <toolset>msvc:<cxxflags>/bigobj
        <toolset>msvc:<cxxflags>/wd4503 # decorated name length exceeded, name was truncated
        <toolset>msvc:<cxxflags>/wd4456 # declaration of 'A' hides previous local declaration
        <toolset>msvc:<cxxflags>/wd4459 # declaration of 'A' hides global declaration
        <toolset>msvc:<cxxflags>/wd4003 # not enough actual parameters for macro 'X' - caused by BOOST_PP_IS_EMPTY and BOOST_PP_IS_BEGIN_PARENS which are used by Fusion
        <toolset>msvc:<cxxflags>/wd4355 # 'this' : used in base member initializer list

        # Disable Intel warnings:
        # warning #177: function "X" was declared but never referenced
        # warning #780: using-declaration ignored -- it refers to the current namespace
        # warning #2196: routine is both "inline" and "noinline"
        # remark #1782: #pragma once is obsolete. Use #ifndef guard instead.
        # remark #193: zero used for undefined preprocessing identifier "X"
        # remark #304: access control not specified ("public" by default)
        # remark #981: operands are evaluated in unspecified order
        # remark #1418: external function definition with no prior declaration
        # Mostly comes from Boost.Phoenix: warning #411: class "X" defines no constructor to initialize the following: reference member "Y"...
        # warning #734: "X" (declared at line N of "file.hpp"), required for copy that was eliminated, is inaccessible
        # warning #279: controlling expression is constant
        <toolset>intel-win:<cxxflags>"/Qwd177,780,2196,1782,193,304,981,1418,411,734,279"
        <toolset>intel-linux:<cxxflags>"-wd177,780,2196,1782,193,304,981,1418,411,734,279"
        <toolset>intel-darwin:<cxxflags>"-wd177,780,2196,1782,193,304,981,1418,411,734,279"

        <toolset>darwin:<cxxflags>-ftemplate-depth-1024
        <toolset>gcc:<cxxflags>-ftemplate-depth-1024

        <toolset>gcc:<cxxflags>-fno-strict-aliasing  # avoids strict aliasing violations in other Boost components

        # Boost.Interprocess does not compile on Cygwin: https://github.com/boostorg/interprocess/issues/76
        <target-os>cygwin:<define>BOOST_LOG_WITHOUT_IPC

        <library>/boost/log//boost_log
        <library>/boost/log//boost_log_setup
        <library>/boost/date_time//boost_date_time
        <library>/boost/regex//boost_regex
        <library>/boost/filesystem//boost_filesystem
        <library>/boost/test//boost_unit_test_framework
        <threading>single:<define>BOOST_LOG_NO_THREADS
        <threading>multi:<library>/boost/thread//boost_thread
    : 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.
        <threading>multi
#        <link>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 ;

    if ! [ os.environ BOOST_LOG_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ]
    {
        local headers_path = [ path.make $(BOOST_ROOT)/libs/log/include/boost/log ] ;
        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_LOG_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) ] ;
    }

    if ! [ os.environ BOOST_LOG_TEST_WITHOUT_EXAMPLES ]
    {
        all_rules += [ build-project ../example ] ;
    }

    #ECHO All rules: $(all_rules) ;
    return $(all_rules) ;
}

test-suite log : [ test_all ] ;