]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/serialization/util/test.jam
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / serialization / util / test.jam
CommitLineData
7c673cae
FG
1# Boost serialization Library utility test Jamfile
2
3# (C) Copyright Robert Ramey 2002-2004.
4# Use, modification, and distribution are subject to the
5# Boost Software License, Version 1.0. (See accompanying file
6# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7#
8
9# the file contains Jam rules which are used in both the normal
10# boost test, as well as the performance test and comprehensive
11# tests.
12
13BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ;
14
15# these are used to shorten testing while in development. It permits
16# testing to be applied to just a particular type of archive
17if ! $(BOOST_ARCHIVE_LIST) {
18 BOOST_ARCHIVE_LIST =
19 "text_archive.hpp"
20 "text_warchive.hpp"
21 "binary_archive.hpp"
22 "xml_archive.hpp"
23 "xml_warchive.hpp"
24 ;
25 # enable the tests which don't depend on a particular archive
26 BOOST_SERIALIZATION_TEST = true ;
27}
28
29rule run-template ( test-name : sources * : requirements * ) {
30 return [
31 run
32 $(sources)
33 : # command
34 : # input files
35 : # requirements
36 # toolset warnings
37 <toolset>borland:<cxxflags>"-w-8080 -w-8071 -w-8057 -w-8062 -w-8008 -w-0018 -w-8066"
38 #<toolset>gcc:<warnings>all # ?
39 <toolset>gcc:<cxxflags>"-Wno-unused-variable -Wno-long-long"
b32b8144
FG
40 # <toolset>gcc:<variant>debug><define>_STLP_DEBUG
41 # <toolset>gcc:<variant>debug><define>_GLIBCXX_DEBUG
7c673cae
FG
42 <toolset>darwin:<cxxflags>"-Wno-unused-variable -Wno-long-long"
43 <toolset>msvc:<warnings>all # == /W4
44 <toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
45 <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
46 <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
47 <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
48 <toolset>msvc:<cxxflags>"-wd4996"
49 <toolset>clang:<variant>debug:<cxxflags>"-fsanitize=memory"
50 # toolset optimizations
51 <toolset>gcc:<cxxflags>"-ftemplate-depth-255"
b32b8144 52 <toolset>qcc:<cxxflags>"-ftemplate-depth-255"
7c673cae
FG
53 <toolset>clang:<cxxflags>"-ftemplate-depth-255"
54 <toolset>darwin:<cxxflags>"-ftemplate-depth-255"
55 <toolset>msvc:<cxxflags>"-Gy"
b32b8144
FG
56 # linking
57 <link>shared:<define>BOOST_SERIALIZATION_DYN_LINK=1
58 <link>shared:<define>BOOST_WSERIALIZATION_DYN_LINK=1
7c673cae
FG
59 $(requirements)
60 : # test name
61 $(test-name)
62 ] ;
63}
64
65# Given a name of test, return the 'save' test that must be run
66# before the named test, or empty string if there's no such test.
67rule dependency-save-test ( test )
68{
69 local m = [ MATCH (.*)load(.*) : $(test) ] ;
70 if $(m)
71 {
72 return $(m[1])save$(m[2]) ;
73 }
74}
75
76# each of the following tests is run with each type of archive
77rule run-invoke ( test-name : sources * : requirements * )
78{
79 local save-test = [ dependency-save-test $(test-name) ] ;
80
81 local tests ;
82 tests += [
83 run-template $(test-name)
84 : # sources
85 $(sources)
86 ../build//boost_serialization
87 : # requirements
88 $(requirements)
89 <define>BOOST_LIB_DIAGNOSTIC=1
90 <dependency>$(save-test)
91 ] ;
92 return $(tests) ;
93}
94
95# each of the following tests is run with each type of archive
96rule run-winvoke ( test-name : sources * : requirements * )
97{
98 local save-test = [ dependency-save-test $(test-name) ] ;
99
100 local tests ;
101 tests += [
102 run-template $(test-name)
103 : # sources
104 $(sources)
105 ../build//boost_serialization
106 ../build//boost_wserialization
107 : # requirements
108 $(requirements)
109 <define>BOOST_LIB_DIAGNOSTIC=1
110 # both stlport and msvc6 define iswspace
111 <toolset>msvc,<stdlib>stlport:<linkflags>"-force:multiple"
112 <dependency>$(save-test)
113 <dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
114 ] ;
115 return $(tests) ;
116}
117
118# for tests which don't use library code - usually just headers
119rule test-bsl-run-no-lib ( test-name : sources * : requirements * )
120{
121 local tests ;
122 tests += [
123 run-template $(test-name)
124 : # sources
125 $(test-name).cpp $(sources).cpp
126 :
127 $(requirements)
128 ] ;
129 return $(tests) ;
130}
131
132# for tests which are run just once rather than for every archive
133rule test-bsl-run ( test-name : sources * : libs * : requirements * )
134{
135 local tests ;
136 tests += [
137 run-invoke $(test-name)
138 : # sources
139 $(test-name).cpp $(sources).cpp $(libs)
140 :
141 $(requirements)
142 ] ;
143 return $(tests) ;
144}
145
146rule test-bsl-run_archive ( test-name : archive-name : sources * : libs * : requirements * ) {
147 local tests ;
148 switch $(archive-name) {
149 case "*_warchive" :
150 tests += [
151 run-winvoke $(test-name)_$(archive-name)
152 :
153 $(sources).cpp $(libs)
154 :
155 <define>BOOST_ARCHIVE_TEST=$(archive-name).hpp
156 $(requirements)
157 ] ;
158 case "*" :
159 tests += [
160 run-invoke $(test-name)_$(archive-name)
161 :
162 $(sources).cpp $(libs)
163 :
164 <define>BOOST_ARCHIVE_TEST=$(archive-name).hpp
165 $(requirements)
166 ] ;
167 }
168 return $(tests) ;
169}
170
171rule test-bsl-run_files ( test-name : sources * : libs * : requirements * ) {
172 local tests ;
173 for local defn in $(BOOST_ARCHIVE_LIST) {
174 tests += [
175 test-bsl-run_archive $(test-name)
176 : $(defn:LB)
177 : $(test-name) $(sources)
178 : $(libs)
179 : $(requirements)
180 ] ;
181 }
182 return $(tests) ;
183}
184
185rule test-bsl-run_polymorphic_archive ( test-name : sources * : requirements * ) {
186 local tests ;
187 for local defn in $(BOOST_ARCHIVE_LIST) {
188 tests += [
189 test-bsl-run_archive $(test-name)
190 : polymorphic_$(defn:LB)
191 : $(test-name) $(sources) $(requirements)
192 ] ;
193 }
194 return $(tests) ;
195}
196