summaryrefslogtreecommitdiff
path: root/libs/serialization/util/test.jam.orig
blob: 8d0c3d9b1f71010b243db73cf834a7498732e95b (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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# Boost serialization Library utility test Jamfile

#  (C) Copyright Robert Ramey 2002-2004.
#  Use, modification, and distribution are subject to 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 contains Jam rules which are used in both the normal
# boost test, as well as the performance test and comprehensive
# tests.

BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ;

# these are used to shorten testing while in development.  It permits
# testing to be applied to just a particular type of archive
if ! $(BOOST_ARCHIVE_LIST) {
    BOOST_ARCHIVE_LIST = 
        "text_archive.hpp" 
        "text_warchive.hpp" 
        "binary_archive.hpp" 
        "xml_archive.hpp" 
        "xml_warchive.hpp" 
    ;
    # enable the tests which don't depend on a particular archive
    BOOST_SERIALIZATION_TEST = true ;
}

rule run-template ( test-name : sources * : requirements * ) {
    return [
        run
            $(sources)
        : # command
        : # input files
        : # requirements
            # toolset warnings
            # <toolset>gcc:<cxxflags>"-Wno-non-virtual-dtor -Wno-ctor-dtor-privacy"
            <toolset>borland:<cxxflags>"-w-8080 -w-8071 -w-8057 -w-8062 -w-8008 -w-0018 -w-8066"
            <toolset>gcc:<warnings>all # ?
            <toolset>gcc:<cxxflags>"-Wno-long-long"
            <toolset>msvc:<warnings>all # == /W4
            <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>msvc:<cxxflags>"-wd4996"
            # toolset optimizations
            <toolset>gcc:<cxxflags>"-ftemplate-depth-255"
            <toolset>clang:<cxxflags>"-ftemplate-depth-255"
<<<<<<< HEAD
=======
            <toolset>clang-darwin:<cxxflags>"-ftemplate-depth-255"
            <toolset>darwin:<cxxflags>"-ftemplate-depth-255"
>>>>>>> develop
            <toolset>msvc:<cxxflags>"-Gy"
            $(requirements)
        : # test name
            $(test-name)
    ] ;
}

# Given a name of test, return the 'save' test that must be run
# before the named test, or empty string if there's no such test.
rule dependency-save-test ( test )
{
    local m = [ MATCH (.*)load(.*) : $(test) ] ;
    if $(m)
    {
        return $(m[1])save$(m[2]) ;
    }  
}

# each of the following tests is run with each type of archive
rule run-invoke ( test-name : sources * : requirements * )
{
    local save-test = [ dependency-save-test $(test-name) ] ;

    local tests ;
    tests += [ 
        run-template $(test-name)
        : # sources
            $(sources)
            ../build//boost_serialization
        : # requirements
            $(requirements)
            <define>BOOST_LIB_DIAGNOSTIC=1
            <dependency>$(save-test)
    ] ;
    return $(tests) ;
}

# each of the following tests is run with each type of archive
rule run-winvoke ( test-name : sources * : requirements * )
{
    local save-test = [ dependency-save-test $(test-name) ] ;

    local tests ;
    tests += [ 
        run-template $(test-name)
        : # sources
            $(sources)
            ../build//boost_serialization
            ../build//boost_wserialization
        : # requirements
            $(requirements)
            <define>BOOST_LIB_DIAGNOSTIC=1
            # both stlport and msvc6 define iswspace
            <toolset>msvc,<stdlib>stlport:<linkflags>"-force:multiple"
            <dependency>$(save-test)
            <dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
    ] ;
    return $(tests) ;
}

# for tests which don't use library code - usually just headers
rule test-bsl-run-no-lib  ( test-name : sources * : requirements * )
{
    local tests ;
    tests += [ 
        run-template $(test-name)
        : # sources
            $(test-name).cpp $(sources).cpp
        :
            $(requirements)
    ] ;
    return $(tests) ;
}

# for tests which are run just once rather than for every archive
rule test-bsl-run ( test-name : sources * : libs * : requirements * )
{
    local tests ;
    tests +=  [ 
        run-invoke $(test-name) 
        : # sources
            $(test-name).cpp $(sources).cpp $(libs)
        :
            $(requirements)
    ] ;
    return $(tests) ;
}

rule test-bsl-run_archive ( test-name : archive-name : sources * : libs * : requirements * ) {
    local tests ;
    switch $(archive-name) {
    case "*_warchive" :
        tests +=  [
            run-winvoke $(test-name)_$(archive-name)
            : 
                $(sources).cpp $(libs)
            :
                <define>BOOST_ARCHIVE_TEST=$(archive-name).hpp
                $(requirements)
        ] ;
    case "*" :
        tests +=  [
            run-invoke $(test-name)_$(archive-name)
            : 
                $(sources).cpp $(libs)
            : 
                <define>BOOST_ARCHIVE_TEST=$(archive-name).hpp
                $(requirements)
        ] ;
    }
    return $(tests) ;
}

rule test-bsl-run_files ( test-name : sources * : libs * : requirements * ) {
    local tests ;
    for local defn in $(BOOST_ARCHIVE_LIST) {
        tests += [ 
            test-bsl-run_archive $(test-name) 
            : $(defn:LB) 
            : $(test-name) $(sources) 
            : $(libs)
            : $(requirements)
        ] ;
    }
    return $(tests) ;
}
    
rule test-bsl-run_polymorphic_archive ( test-name : sources * ) {
    local tests ;
    for local defn in $(BOOST_ARCHIVE_LIST) {
        tests += [ 
            test-bsl-run_archive $(test-name)
            : polymorphic_$(defn:LB)  
            : $(test-name) $(sources)
        ] ;
    }
    return $(tests) ;
}