]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Copyright Andrey Semashev 2007 - 2015. | |
3 | # Distributed under the Boost Software License, Version 1.0. | |
4 | # (See accompanying file LICENSE_1_0.txt or copy at | |
5 | # http://www.boost.org/LICENSE_1_0.txt) | |
6 | # | |
7 | # The file was adapted from libs/tr2/test/Jamfile.v2 by John Maddock. | |
8 | ||
9 | import testing ; | |
10 | import path ; | |
11 | import regex ; | |
12 | import os ; | |
13 | import ../build/log-platform-config ; | |
14 | ||
15 | project | |
16 | : requirements | |
17 | <conditional>@log-platform-config.set-platform-defines | |
18 | ||
19 | <include>common | |
20 | ||
21 | <c++-template-depth>1024 | |
22 | ||
23 | <toolset>msvc:<cxxflags>/bigobj | |
24 | <toolset>msvc:<cxxflags>/wd4503 # decorated name length exceeded, name was truncated | |
25 | <toolset>msvc:<cxxflags>/wd4456 # declaration of 'A' hides previous local declaration | |
26 | <toolset>msvc:<cxxflags>/wd4459 # declaration of 'A' hides global declaration | |
27 | <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 | |
28 | <toolset>msvc:<cxxflags>/wd4355 # 'this' : used in base member initializer list | |
29 | ||
30 | # Disable Intel warnings: | |
31 | # warning #177: function "X" was declared but never referenced | |
32 | # warning #780: using-declaration ignored -- it refers to the current namespace | |
33 | # warning #2196: routine is both "inline" and "noinline" | |
34 | # remark #1782: #pragma once is obsolete. Use #ifndef guard instead. | |
35 | # remark #193: zero used for undefined preprocessing identifier "X" | |
36 | # remark #304: access control not specified ("public" by default) | |
37 | # remark #981: operands are evaluated in unspecified order | |
38 | # remark #1418: external function definition with no prior declaration | |
39 | # Mostly comes from Boost.Phoenix: warning #411: class "X" defines no constructor to initialize the following: reference member "Y"... | |
40 | # warning #734: "X" (declared at line N of "file.hpp"), required for copy that was eliminated, is inaccessible | |
41 | # warning #279: controlling expression is constant | |
42 | <toolset>intel-win:<cxxflags>"/Qwd177,780,2196,1782,193,304,981,1418,411,734,279" | |
43 | <toolset>intel-linux:<cxxflags>"-wd177,780,2196,1782,193,304,981,1418,411,734,279" | |
44 | <toolset>intel-darwin:<cxxflags>"-wd177,780,2196,1782,193,304,981,1418,411,734,279" | |
45 | ||
46 | <toolset>gcc:<cxxflags>-fno-strict-aliasing # avoids strict aliasing violations in other Boost components | |
47 | ||
48 | # Boost.Interprocess does not compile on Cygwin: https://github.com/boostorg/interprocess/issues/76 | |
49 | <target-os>cygwin:<define>BOOST_LOG_WITHOUT_IPC | |
50 | ||
51 | <library>/boost/log//boost_log | |
52 | <library>/boost/log//boost_log_setup | |
53 | <library>/boost/regex//boost_regex | |
54 | <library>/boost/filesystem//boost_filesystem | |
55 | <library>/boost/test//boost_unit_test_framework | |
56 | <threading>single:<define>BOOST_LOG_NO_THREADS | |
57 | <threading>multi:<library>/boost/thread//boost_thread | |
58 | : default-build | |
59 | # 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. | |
60 | <threading>multi | |
61 | # <link>static | |
62 | ; | |
63 | ||
64 | # this rule enumerates through all the sources and invokes | |
65 | # the run rule for each source, the result is a list of all | |
66 | # the run rules, which we can pass on to the test_suite rule: | |
67 | rule test_all | |
68 | { | |
69 | local all_rules ; | |
70 | local file ; | |
71 | ||
72 | if ! [ os.environ BOOST_LOG_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ] | |
73 | { | |
74 | local headers_path = [ path.make $(BOOST_ROOT)/libs/log/include/boost/log ] ; | |
75 | for file in [ path.glob-tree $(headers_path) : *.hpp : detail ] | |
76 | { | |
77 | local rel_file = [ path.relative-to $(headers_path) $(file) ] ; | |
78 | # Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end. | |
79 | # All '/' are replaced with '-' because apparently test scripts have a problem with test names containing slashes. | |
80 | local test_name = [ regex.replace ~hdr/$(rel_file) "/" "-" ] ; | |
81 | #ECHO $(rel_file) ; | |
82 | all_rules += [ compile compile/self_contained_header.cpp : <define>"BOOST_LOG_TEST_HEADER=$(rel_file)" <dependency>$(file) : $(test_name) ] ; | |
83 | } | |
84 | } | |
85 | ||
86 | for file in [ glob compile/*.cpp ] | |
87 | { | |
88 | if [ path.basename $(file) ] != "self_contained_header.cpp" | |
89 | { | |
90 | all_rules += [ compile $(file) ] ; | |
91 | } | |
92 | } | |
93 | for file in [ glob compile_fail/*.cpp ] | |
94 | { | |
95 | all_rules += [ compile-fail $(file) ] ; | |
96 | } | |
97 | for file in [ glob run/*.cpp ] | |
98 | { | |
99 | all_rules += [ run $(file) ] ; | |
100 | } | |
101 | ||
102 | if ! [ os.environ BOOST_LOG_TEST_WITHOUT_EXAMPLES ] | |
103 | { | |
104 | all_rules += [ build-project ../example ] ; | |
105 | } | |
106 | ||
107 | #ECHO All rules: $(all_rules) ; | |
108 | return $(all_rules) ; | |
109 | } | |
110 | ||
111 | test-suite log : [ test_all ] ; |