File: generate

package info (click to toggle)
boost 1.32.0-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 93,952 kB
  • ctags: 128,458
  • sloc: cpp: 492,477; xml: 52,125; python: 13,519; ansic: 13,013; sh: 1,773; yacc: 853; makefile: 526; perl: 418; lex: 110; csh: 6
file content (400 lines) | stat: -rw-r--r-- 10,629 bytes parent folder | download
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
#!/bin/sh
#  (C) Copyright John Maddock 2001 - 2003. 
#  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)

//  See http://www.boost.org/libs/config for the most recent version.

#get date:
date_string=`date`

# init config file:
cat > ../test/regression.cfg << EOF
//
// regression test script for boost configuration setup
//
run libs/config/test/config_info.cpp
run libs/config/test/config_test.cpp
run libs/config/test/limits_test.cpp
compile-fail threads/test_thread_fail1.cpp ;
compile-fail threads/test_thread_fail2.cpp ;

EOF
cat > ../test/Jamfile << EOF
#
# Regression test Jamfile for boost configuration setup.
# *** DO NOT EDIT THIS FILE BY HAND ***
# This file was automatically generated on $date_string,
# by libs/config/tools/generate
# Copyright John Maddock.
#
# If you need to alter build preferences then set them in
# the template defined in options.jam.
#
subproject libs/config/test ;
# bring in the rules for testing
import testing ./options ;

run config_info.cpp <template>config_options ;
run config_test.cpp <template>config_options ;
run limits_test.cpp <template>config_test_options ;
run abi/abi_test.cpp abi/main.cpp <template>config_options ;

EOF

# init main config test file:
cat > ../test/config_test.cpp << EOF
//  This file was automatically generated on $date_string,
//  by libs/config/tools/generate
//  Copyright John Maddock 2002-4.
//  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)

//  See http://www.boost.org/libs/config for the most recent version.

// Test file for config setup
// This file should compile, if it does not then
// one or more macros need to be defined.
// see boost_*.ipp for more details

// Do not edit this file, it was generated automatically by
// ../tools/generate from boost_*.ipp on
// $date_string

#include <boost/config.hpp>
#include <iostream>
#include "test.hpp"

int error_count = 0;

EOF

all_no=""
all_has=""

#
# enumerate through the boost_no* test files:
#
for file in ../test/boost_no_*.ipp; do

   basename=`echo $file | sed 's/.*boost_\(.*\)\.ipp/\1/'`
   macroname=`cat $file | grep '^//[   ]*MACRO:' | sed 's/.*MACRO:[  ]*\([_A-Z0-9]*\).*/\1/'`
   title=`cat $file | grep '^//[    ]*TITLE:' | sed 's/.*TITLE:[  ]*\([^   ].*\)/\1/'`
   namespace=`echo $macroname | tr [:upper:] [:lower:]`
   
   echo "Processing $file..."
   echo
   echo "Basename:  $basename"
   echo "Macro:     $macroname"
   echo "Title:     $title"
   echo "Namespace: $namespace"
   # now create positive test file:
   if test -f "../test/$basename""_pass.cpp"; then
      echo "skipping file ../test/$basename""_pass.cpp"
   else
      echo "generating file ../test/$basename""_pass.cpp"
   cat > "../test/$basename""_pass.cpp" << EOF

//  This file was automatically generated on $date_string,
//  by libs/config/tools/generate
//  Copyright John Maddock 2002-4.
//  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)

//  See http://www.boost.org/libs/config for the most recent version.

// Test file for macro $macroname
// This file should compile, if it does not then
// $macroname needs to be defined.
// see boost_$basename.ipp for more details

// Do not edit this file, it was generated automatically by
// ../tools/generate from boost_$basename.ipp on
// $date_string

// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
#  undef BOOST_ASSERT_CONFIG
#endif

#include <boost/config.hpp>
#include "test.hpp"

#ifndef $macroname
#include "boost_$basename.ipp"
#else
namespace ${namespace} = empty_boost;
#endif

int main( int, char *[] )
{
   return ${namespace}::test();
}  
   
EOF

   fi
   
   # now create negative test file:
   if test -f "../test/$basename""_fail.cpp"; then
      echo "skipping file ../test/$basename""_fail.cpp"
   else
      echo "generating file ../test/$basename""_fail.cpp"
   cat > "../test/$basename""_fail.cpp" << EOF

//  This file was automatically generated on $date_string,
//  by libs/config/tools/generate
//  Copyright John Maddock 2002-4.
//  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)

//  See http://www.boost.org/libs/config for the most recent version.

// Test file for macro $macroname
// This file should not compile, if it does then
// $macroname need not be defined.
// see boost_$basename.ipp for more details

// Do not edit this file, it was generated automatically by
// ../tools/generate from boost_$basename.ipp on
// $date_string

// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
#  undef BOOST_ASSERT_CONFIG
#endif

#include <boost/config.hpp>
#include "test.hpp"

#ifdef $macroname
#include "boost_$basename.ipp"
#else
#error "this file should not compile"
#endif

int main( int, char *[] )
{
   return ${namespace}::test();
}  
   
EOF
   fi
   
   # now append to config_test.cpp:
   cat >> "../test/config_test.cpp" << EOF
#ifndef $macroname
#include "boost_$basename.ipp"
#else
namespace ${namespace} = empty_boost;
#endif
EOF
   all_no="$namespace $all_no"

   # output regression tests:
   echo "run libs/config/test/$basename""_pass.cpp" >> ../test/regression.cfg
   echo "compile-fail libs/config/test/$basename""_fail.cpp" >> ../test/regression.cfg
   
   echo 'test-suite "'$macroname'" : ' >> ../test/Jamfile
   echo "[ run $basename""_pass.cpp <template>config_options ]" >> ../test/Jamfile
   echo "[ compile-fail $basename""_fail.cpp <template>config_options ] ;" >> ../test/Jamfile
   
done

#
# enumerate through the boost_has* test files:
#
for file in ../test/boost_has_*.ipp; do

   basename=`echo $file | sed 's/.*boost_\(.*\)\.ipp/\1/'`
   macroname=`cat $file | grep '^//[   ]*MACRO:' | sed 's/.*MACRO:[  ]*\([_A-Z0-9]*\).*/\1/'`
   title=`cat $file | grep '^//[    ]*TITLE:' | sed 's/.*TITLE:[  ]*\([^   ].*\)/\1/'`
   namespace=`echo $macroname | tr [:upper:] [:lower:]`
   
#  echo $basename
   echo
   echo "processing $macroname ..."
#  echo $title
#  echo $namespace

   # now create positive test file:
   if test -f "../test/$basename""_pass.cpp"; then
      echo "skipping file ../test/$basename""_pass.cpp"
   else
      echo "generating file ../test/$basename""_pass.cpp"
   cat > "../test/$basename""_pass.cpp" << EOF

//  This file was automatically generated on $date_string,
//  by libs/config/tools/generate
//  Copyright John Maddock 2002-4.
//  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)

//  See http://www.boost.org/libs/config for the most recent version.

// Test file for macro $macroname
// This file should compile, if it does not then
// $macroname should not be defined.
// see boost_$basename.ipp for more details

// Do not edit this file, it was generated automatically by
// ../tools/generate from boost_$basename.ipp on
// $date_string

// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
#  undef BOOST_ASSERT_CONFIG
#endif

#include <boost/config.hpp>
#include "test.hpp"

#ifdef $macroname
#include "boost_$basename.ipp"
#else
namespace ${namespace} = empty_boost;
#endif

int main( int, char *[] )
{
   return ${namespace}::test();
}  
   
EOF
   fi

   # now create negative test file:
   if test -f "../test/$basename""_fail.cpp"; then
      echo skipping file "../test/$basename""_fail.cpp"
   else
      echo generating file "../test/$basename""_fail.cpp"
   cat > "../test/$basename""_fail.cpp" << EOF

//  This file was automatically generated on $date_string,
//  by libs/config/tools/generate
//  Copyright John Maddock 2002-4.
//  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)

//  See http://www.boost.org/libs/config for the most recent version.

// Test file for macro $macroname
// This file should not compile, if it does then
// $macroname may be defined.
// see boost_$basename.ipp for more details

// Do not edit this file, it was generated automatically by
// ../tools/generate from boost_$basename.ipp on
// $date_string

// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
#  undef BOOST_ASSERT_CONFIG
#endif

#include <boost/config.hpp>
#include "test.hpp"

#ifndef $macroname
#include "boost_$basename.ipp"
#else
#error "this file should not compile"
#endif

int main( int, char *[] )
{
   return ${namespace}::test();
}  
   
EOF
   fi

   # now append to config_test.cpp:
   cat >> "../test/config_test.cpp" << EOF
#ifdef $macroname
#include "boost_$basename.ipp"
#else
namespace ${namespace} = empty_boost;
#endif
EOF
   all_has="$namespace $all_has"

   # output regression tests:
   echo "run libs/config/test/$basename""_pass.cpp" >> ../test/regression.cfg
   echo "compile-fail libs/config/test/$basename""_fail.cpp" >> ../test/regression.cfg
   
   echo 'test-suite "'$macroname'" : ' >> ../test/Jamfile
   echo "[ run $basename""_pass.cpp <template>config_options ]" >> ../test/Jamfile
   echo "[ compile-fail $basename""_fail.cpp <template>config_options ] ;" >> ../test/Jamfile

done


#
# finish off config_test.cpp:
#
   echo generating "../test/config_test.cpp"
   cat >> "../test/config_test.cpp" << EOF

int main( int, char *[] )
{
EOF

for macro in $all_no; do
   cat >> "../test/config_test.cpp" << EOF
   if(0 != ${macro}::test())
   {
      std::cerr << "Failed test for $macroname at: " << __FILE__ << ":" << __LINE__ << std::endl;
      ++error_count;
   }
EOF

done
for macro in $all_has; do
   cat >> "../test/config_test.cpp" << EOF
   if(0 != ${macro}::test())
   {
      std::cerr << "Failed test for $macroname at: " << __FILE__ << ":" << __LINE__ << std::endl;
      ++error_count;
   }
EOF

done
   cat >> "../test/config_test.cpp" << EOF
   return error_count;
}
EOF

#rm -f ../config.*
echo "updating configure script..."
autoconf ../tools/configure.in > ../configure
echo