Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / serialization / util / test.jam.orig
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
13 BOOST_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
17 if ! $(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
29 rule run-template ( test-name : sources * : requirements * ) {
30     return [
31         run
32             $(sources)
33         : # command
34         : # input files
35         : # requirements
36             # toolset warnings
37             # <toolset>gcc:<cxxflags>"-Wno-non-virtual-dtor -Wno-ctor-dtor-privacy"
38             <toolset>borland:<cxxflags>"-w-8080 -w-8071 -w-8057 -w-8062 -w-8008 -w-0018 -w-8066"
39             <toolset>gcc:<warnings>all # ?
40             <toolset>gcc:<cxxflags>"-Wno-long-long"
41             <toolset>msvc:<warnings>all # == /W4
42             <toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
43             <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
44             <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
45             <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
46             <toolset>msvc:<cxxflags>"-wd4996"
47             # toolset optimizations
48             <toolset>gcc:<cxxflags>"-ftemplate-depth-255"
49             <toolset>clang:<cxxflags>"-ftemplate-depth-255"
50 <<<<<<< HEAD
51 =======
52             <toolset>clang-darwin:<cxxflags>"-ftemplate-depth-255"
53             <toolset>darwin:<cxxflags>"-ftemplate-depth-255"
54 >>>>>>> develop
55             <toolset>msvc:<cxxflags>"-Gy"
56             $(requirements)
57         : # test name
58             $(test-name)
59     ] ;
60 }
61
62 # Given a name of test, return the 'save' test that must be run
63 # before the named test, or empty string if there's no such test.
64 rule dependency-save-test ( test )
65 {
66     local m = [ MATCH (.*)load(.*) : $(test) ] ;
67     if $(m)
68     {
69         return $(m[1])save$(m[2]) ;
70     }  
71 }
72
73 # each of the following tests is run with each type of archive
74 rule run-invoke ( test-name : sources * : requirements * )
75 {
76     local save-test = [ dependency-save-test $(test-name) ] ;
77
78     local tests ;
79     tests += [ 
80         run-template $(test-name)
81         : # sources
82             $(sources)
83             ../build//boost_serialization
84         : # requirements
85             $(requirements)
86             <define>BOOST_LIB_DIAGNOSTIC=1
87             <dependency>$(save-test)
88     ] ;
89     return $(tests) ;
90 }
91
92 # each of the following tests is run with each type of archive
93 rule run-winvoke ( test-name : sources * : requirements * )
94 {
95     local save-test = [ dependency-save-test $(test-name) ] ;
96
97     local tests ;
98     tests += [ 
99         run-template $(test-name)
100         : # sources
101             $(sources)
102             ../build//boost_serialization
103             ../build//boost_wserialization
104         : # requirements
105             $(requirements)
106             <define>BOOST_LIB_DIAGNOSTIC=1
107             # both stlport and msvc6 define iswspace
108             <toolset>msvc,<stdlib>stlport:<linkflags>"-force:multiple"
109             <dependency>$(save-test)
110             <dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
111     ] ;
112     return $(tests) ;
113 }
114
115 # for tests which don't use library code - usually just headers
116 rule test-bsl-run-no-lib  ( test-name : sources * : requirements * )
117 {
118     local tests ;
119     tests += [ 
120         run-template $(test-name)
121         : # sources
122             $(test-name).cpp $(sources).cpp
123         :
124             $(requirements)
125     ] ;
126     return $(tests) ;
127 }
128
129 # for tests which are run just once rather than for every archive
130 rule test-bsl-run ( test-name : sources * : libs * : requirements * )
131 {
132     local tests ;
133     tests +=  [ 
134         run-invoke $(test-name) 
135         : # sources
136             $(test-name).cpp $(sources).cpp $(libs)
137         :
138             $(requirements)
139     ] ;
140     return $(tests) ;
141 }
142
143 rule test-bsl-run_archive ( test-name : archive-name : sources * : libs * : requirements * ) {
144     local tests ;
145     switch $(archive-name) {
146     case "*_warchive" :
147         tests +=  [
148             run-winvoke $(test-name)_$(archive-name)
149             : 
150                 $(sources).cpp $(libs)
151             :
152                 <define>BOOST_ARCHIVE_TEST=$(archive-name).hpp
153                 $(requirements)
154         ] ;
155     case "*" :
156         tests +=  [
157             run-invoke $(test-name)_$(archive-name)
158             : 
159                 $(sources).cpp $(libs)
160             : 
161                 <define>BOOST_ARCHIVE_TEST=$(archive-name).hpp
162                 $(requirements)
163         ] ;
164     }
165     return $(tests) ;
166 }
167
168 rule test-bsl-run_files ( test-name : sources * : libs * : requirements * ) {
169     local tests ;
170     for local defn in $(BOOST_ARCHIVE_LIST) {
171         tests += [ 
172             test-bsl-run_archive $(test-name) 
173             : $(defn:LB) 
174             : $(test-name) $(sources) 
175             : $(libs)
176             : $(requirements)
177         ] ;
178     }
179     return $(tests) ;
180 }
181     
182 rule test-bsl-run_polymorphic_archive ( test-name : sources * ) {
183     local tests ;
184     for local defn in $(BOOST_ARCHIVE_LIST) {
185         tests += [ 
186             test-bsl-run_archive $(test-name)
187             : polymorphic_$(defn:LB)  
188             : $(test-name) $(sources)
189         ] ;
190     }
191     return $(tests) ;
192 }
193
194