Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/graph/example/regrtest.py @ 24

Last change on this file since 24 was 12, checked in by landauf, 18 years ago

added boost

File size: 12.0 KB
Line 
1#!/usr/bin/python
2
3# boost graph library compilation regression test
4
5# Usage: regrtest [*|compiler] [*|library/program]
6#
7# Default: regrtest * *
8#
9# Compilers:  bcc   = Borland 5.5.1
10#             cw    = Metrowerks CodeWarrior
11#             gcc   = GNU GCC
12#             gcc-stlport  = GNU GCC with STLport library
13#             como  = Comeau C++
14#             vc    = Microsoft Visual C++
15#             vcstlport  = Microsoft Visual C++ with STLport library
16#             suncc = Sun's C++ compiler
17#             kcc = KAI C++ 3.4g
18#
19# Examples: regrtest
20#           regrtest
21#           regrtest gcc
22#           regrtest * smart_ptr/smart_ptr_test.cpp
23#           regrtest gcc smart_ptr/smart_ptr_test.cpp
24#
25# Note: use the following command line syntax if output is to be redirected:
26#           python regrtest.py [*|compiler] [*|library/program]  >log 2>&1
27
28# Revision history:
29#  09 Dec 00 Modified the main boost regrtest.py to create this file. -Jeremy
30
31
32# The Metrowerks and Microsoft compilers require various environment variables be set.
33#   See mwcc -help
34#   See http://msdn.microsoft.com/library/devprods/vs6/visualc/vccore/_core_building_on_the_command_line.3a_.overview.htm
35# Others:
36#   See bcb4.hlp.  Don't bother with bcb4tools.hlp; it has a bad link to the command line options
37
38import sys
39import os
40import time
41
42#------------------------------------------------------------------------------#
43
44def invoke( desc, command ):
45
46  print " ", desc
47  f.write( "<td>" )
48  print "  ", command     #script debugging aid
49  sys.stdout.flush()
50  rs=os.system( command )
51  print " return status: ", rs
52  if rs==0:
53    f.write( "yes" )
54  else:
55    f.write( "no" )
56  f.write( "</td>\n" )
57
58#------------------------------------------------------------------------------#
59
60def compile( program ):
61
62  fullpath= path + "/libs/" + program
63
64  print
65  print "*****", program, "*****"
66
67  f.write( "<tr>\n" )
68  f.write( "<td><a href=\"" + program + "\">" + program + "</a></td>\n" )
69
70# ----------  Linux2 ---------- #
71
72  if sys.platform == "linux2": 
73    if compiler_arg == "*" or compiler_arg == "gcc":
74      invoke( "GCC 2.95.2", 'g++ -ftemplate-depth-30 -c -I' + path + ' ' + fullpath )
75    if compiler_arg == "*" or compiler_arg == "gcc-stlport":
76      invoke( "GCC 2.95.2 STLport 4.0", 'g++ -V 2.95.2-stlport -c -ftemplate-depth-30 -I' + path + ' ' + fullpath )
77#    if compiler_arg == "*" or compiler_arg == "gcc-exp":
78#      invoke( "GCC pre-2.97 experimental", '/opt/exp/gcc/bin/g++ -ftemplate-depth-30 -I' + path + ' ' + fullpath )
79    if compiler_arg == "*" or compiler_arg == "como":
80      invoke( "Comeau C++ 4.2.44 beta3", 'como -c -I' + path + ' ' + fullpath)
81#    if compiler_arg == "*" or compiler_arg == "occ":
82#      invoke( "OpenC++ 2.5.9", 'occ -c --regular-c++ -I' + path + ' ' + fullpath)
83
84# ----------- Solaris (Sun OS 5)/Sparc ------ #
85
86  elif sys.platform == "sunos5":
87    if compiler_arg == "*" or compiler_arg =="suncc":
88        invoke("Sun WorkShop 6 2000/04/07 C++ 5.1", 'CC -c -I' + path + ' ' + fullpath )
89    if compiler_arg == "*" or compiler_arg == "gcc":
90      invoke( "GCC 2.95.2", 'g++ -Wall -pedantic -ftemplate-depth-30 -Wno-long-long -c -I' + path + ' ' + fullpath )
91    if compiler_arg == "*" or compiler_arg == "kcc":
92      invoke( "KCC 3.4g", 'KCC --strict_warnings -lm -I' + path + ' ' + fullpath )
93
94
95# ----------- BeOS5/Intel ------ #
96#
97# currently this compiler fails so many tests that it may not be worth while
98# reporting the results: most of these are as a result of broken C++ standard
99# libraries and a non-standard <climits>, problems that the forthcoming
100# gcc3 should fix (STLPort does not build on this platform).
101#
102  elif sys.platform == "beos":
103    if compiler_arg=="*" or compiler_arg=="gcc":
104      invoke( "GNU GCC", "c++ -ftemplate-depth-30 -Wall -I" + path + "  " + fullpath )
105    if compiler_arg=="*" or compiler_arg=="gcc-sgi":
106      invoke( "GNU GCC", "c++ -ftemplate-depth-30 -Wall -I/boot/home/config/stlport/stl330 -I" + path + "  " + fullpath )
107
108# ----------  Windows ---------- #
109
110  else:
111#    if compiler_arg=="*" or compiler_arg=="bcc54":
112#      bcc54_path=os.environ["BOOST_BCC54_PATH"]
113#      invoke( "Borland C++ 5.4 up2", "\"" + bcc54_path + "/bcc32\" -I" + path + " -j10 -q " + fullpath )
114    if compiler_arg=="*" or compiler_arg=="bcc":
115      bcc55_path=os.environ["BOOST_BCC55_PATH"]
116      invoke( "Borland C++ 5.5.1", "\"" + bcc55_path + "/bcc32\" -I" + path + " -j10 -q " + fullpath )
117
118    # GCC 2.95.2 is looping on some tests, so only invoke if asked for by name
119    #if compiler_arg=="*" or compiler_arg=="gcc":
120    if compiler_arg=="gcc":
121      # TODO: fix the absolute STLport paths
122      invoke( "GNU GCC", "c++ -ftemplate-depth-30 -I" + path + " -IC:/stl/STLport-4.0b8/stlport  " + fullpath + "  c:/stl/STLport-4.0b8/lib/libstlport_gcc.a" )
123
124    if compiler_arg=="*" or compiler_arg=="cw":
125      invoke( "Metrowerks CodeWarrior", "mwcc -maxerrors 10 -cwd source -I- -I" + path + " " + fullpath )
126
127#John Maddock says use /Zm400 switch; it increases compiler memory
128# /MDd causes compiler errors in VC98\INCLUDE\xlocnum -Jeremy Siek
129    if compiler_arg=="*" or compiler_arg=="vc":
130      invoke( "VC++ with MS library", 'cl /c /nologo /Zm400 /W3 /GR /GX /Zi /Od /GZ /I "' + path + '" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_CONSOLE" ' + fullpath )
131    if compiler_arg=="*" or compiler_arg=="vcstlport":
132      stl=os.environ["BOOST_STLPORT_PATH"]
133      invoke( "VC++ with STLport library", 'cl /c /nologo /Zm400 /W3 /GR /GX /Zi /Od /GZ /I "' + stl + '" /I "' + path + '" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_CONSOLE" ' + fullpath )
134
135
136  f.write( "</tr>\n" )
137
138#------------------------------------------------------------------------------#
139
140def library():
141
142  print
143  print "***** Boost Library *****"
144
145  f.write( "<tr>\n" )
146  f.write( "<td>Boost Graph Library build</td>\n" )
147
148  #if compiler_arg=="*" or compiler_arg=="bcc32":
149  #if compiler_arg=="*" or compiler_arg=="gcc":
150  #if compiler_arg=="*" or compiler_arg=="cw":
151
152  #if compiler_arg=="*" or compiler_arg=="vc":
153  #  command='cl /nologo /MDd /W3 /GR /GX /Zi /Od /GZ /I "' + path + '" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB /c"'
154  #     command=command + " " + path + "/libs/" + ...
155  #  invoke( "VC++ with MS library", command )
156             
157#    invoke( "MS Lib with MS library", 'lib /nologo /out:"boost_vc.lib" boost_timer_vc.obj boost_prg_timer_vc.obj boost_prg_display_vc.obj' )
158
159  #if compiler_arg=="*" or compiler_arg=="vcstlport":
160
161  f.write( "</tr>\n" )
162
163#----------------------------------  main  ------------------------------------#
164
165# set up environment variables
166
167path=os.environ["BOOST_PATH"]
168
169compiler_arg="*"
170if len(sys.argv)>1:
171  compiler_arg=sys.argv[1]
172
173program_arg="*"
174if len(sys.argv)>2:
175  program_arg=sys.argv[2]
176
177if sys.platform == "linux2":
178  platform = "Linux/x86"
179elif sys.platform == "sunos5":
180  platform = "SunOS5/sparc"
181elif sys.platform == "beos":
182  platform = "BeOS5/x86"
183elif sys.platform == "win32":
184  platform = "Windows"
185  if os.name == "nt":
186    platform = platform + " NT / Windows 2000"
187else:
188  print "**** Error: unknown platform ****"
189  sys.exit(1)
190
191f=open( "cs-" + sys.platform + ".html", "w" )
192
193f.write( "<html>\n<head>\n<title>\nCompiler Status: " + platform + "\n</title>\n</head>" )
194f.write( "<body bgcolor=\"#FFFFFF\" text=\"#000000\">\n" )
195f.write( "<h1><img border=\"0\" src=\"../../../boost.png\" width=\"277\" height=\"86\"></h1>\n" )
196f.write( "<h1>Compiler Status: " + platform + "</h1>\n" )
197f.write( "<p><b>Run Date:</b> " + time.strftime("%d %b %Y %H:%M GMT", time.gmtime(time.time())) + "</p>\n" )
198f.write( "<p>\n" )
199f.write( "<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n"  )
200f.write( "<tr>\n" )
201f.write( "<td>Program</td>\n" )
202
203if sys.platform == "linux2": 
204  if compiler_arg == "*" or compiler_arg == "gcc":
205    f.write( "<td>GNU<br>GCC<br>2.95.2</td>\n" )
206  if compiler_arg == "*" or compiler_arg == "gcc-stlport":
207    f.write( "<td>GNU<br>GCC<br>2.95.2<br>STLport<br>4.0</td>\n" )
208#  if compiler_arg == "*" or compiler_arg == "gcc-exp":
209#    f.write( "<td>GNU<br>GCC<br>pre-2.97 experimental</td>\n" )
210  if compiler_arg == "*" or compiler_arg == "como":
211    f.write( "<td>Comeau C++<br>4.2.44 beta3<br>STLport<br>4.0</td>\n" )
212#  if compiler_arg == "*" or compiler_arg == "occ":
213#    f.write( "<td>OpenC++<br>2.5.9</td>\n" )
214elif sys.platform == "sunos5":
215  if compiler_arg == "*" or compiler_arg == "suncc":
216    f.write( "<td>Sun C++<br>Sun WorkShop 6, C++ 5.1</td>\n" )
217  if compiler_arg == "*" or compiler_arg == "gcc":
218    f.write( "<td>GNU<br>GCC<br>2.95.2</td>\n" )
219  if compiler_arg == "*" or compiler_arg == "kcc":
220    f.write( "<td>KAI<br>KCC<br>3.4g</td>\n" )
221elif sys.platform == "beos":
222  if compiler_arg == "*" or compiler_arg == "gcc":
223    f.write( "<td>GNUPro<br>GCC&nbsp;2.9</td>\n" )
224  if compiler_arg == "*" or compiler_arg == "gcc-sgi":
225    f.write( "<td>GNUPro<br>GCC&nbsp;2.9<br>+<br>SGI&nbsp;STL&nbsp;3.3</td>\n" )
226else:
227#  if compiler_arg=="*" or compiler_arg=="bcc54":
228#    f.write( "<td>Borland<br>BCC<br>5.4 up2</td>\n" )
229  if compiler_arg=="*" or compiler_arg=="bcc":
230    f.write( "<td>Borland<br>BCC<br>5.5.1</td>\n" )
231
232  # GCC 2.95.2 is looping on some tests, so only invoke if asked for by name
233  #if compiler_arg=="*" or compiler_arg=="gcc":
234  if compiler_arg=="gcc":
235   f.write( "<td>GNU<br>GCC<br>2.95.2<br>STLport<br>4.0 beta 8</td>\n" )
236  if compiler_arg=="*" or compiler_arg=="cw":
237    f.write( "<td>Metrowerks<br>CodeWarrior<br>6.0</td>\n" )
238  if compiler_arg=="*" or compiler_arg=="vc":
239    f.write( "<td>Microsoft<br>VC++<br>6.0 SP4</td>\n" )
240  if compiler_arg=="*" or compiler_arg=="vcstlport":
241    f.write( "<td>Microsoft<br>VC++<br>6.0 SP4<br>STLport<br>4.0</td>\n" )
242
243f.write( "</tr>\n" )
244
245if  program_arg=="*":
246#  compile( "graph/example/LEDA_concept_check.cpp" )
247  compile( "graph/example/adjacency_list.cpp" )
248  compile( "graph/example/bellman_ford.cpp" )
249  compile( "graph/example/bfs.cpp" )
250  compile( "graph/example/bfs_basics.cpp" )
251  compile( "graph/example/bucket_sorter.cpp" )
252  compile( "graph/example/city_visitor.cpp" )
253  compile( "graph/example/components_on_edgelist.cpp" )
254  compile( "graph/example/concept_checks.cpp" )
255  compile( "graph/example/connected_components.cpp" )
256  compile( "graph/example/container_gen.cpp" )
257  compile( "graph/example/cuthill_mckee_ordering.cpp" )
258  compile( "graph/example/dave.cpp" )
259  compile( "graph/example/dfs.cpp" )
260  compile( "graph/example/dfs_basics.cpp" )
261  compile( "graph/example/dfs_parenthesis.cpp" )
262  compile( "graph/example/dijkstra.cpp" )
263  compile( "graph/example/dynamic_components.cpp" )
264  compile( "graph/example/edge_basics.cpp" )
265  compile( "graph/example/edge_iterator_constructor.cpp" )
266  compile( "graph/example/edge_property.cpp" )
267  compile( "graph/example/exterior_properties.cpp" )
268  compile( "graph/example/exterior_property_map.cpp" )
269  compile( "graph/example/family_tree.cpp" )
270  compile( "graph/example/fibonacci_heap.cpp" )
271  compile( "graph/example/file_dependencies.cpp" )
272  compile( "graph/example/gerdemann.cpp" )
273  compile( "graph/example/graph.cpp" )
274  compile( "graph/example/in_edges.cpp" )
275  compile( "graph/example/interior_property_map.cpp" )
276  compile( "graph/example/johnson.cpp" )
277  compile( "graph/example/kevin_bacon.cpp" )
278  compile( "graph/example/knights_tour.cpp" )
279  compile( "graph/example/kruskal.cpp" )
280  compile( "graph/example/max_flow.cpp" )
281#  compile( "graph/example/miles_span.cpp" )
282  compile( "graph/example/ordered_out_edges.cpp" )
283  compile( "graph/example/prim.cpp" )
284  compile( "graph/example/quick_tour.cpp" )
285  compile( "graph/example/remove_edge_if_bidir.cpp" )
286  compile( "graph/example/remove_edge_if_dir.cpp" )
287  compile( "graph/example/remove_edge_if_undir.cpp" )
288  compile( "graph/example/reverse_graph.cpp" )
289  compile( "graph/example/topo_sort.cpp" )
290  compile( "graph/example/undirected.cpp" )
291  compile( "graph/example/vector_as_graph.cpp" )
292  compile( "graph/example/vertex_basics.cpp" )
293  compile( "graph/example/visitor.cpp" )
294else:
295  compile( program_arg )
296
297f.write( "</table>\n" );
298if sys.platform == "linux2":
299  f.write( "<p>\nNote: A hand-crafted &lt;limits&gt; Standard header has been applied to all configurations.\n" )
300f.write( "</body>\n</html>\n" )
301
302# end
303
304
305
306
Note: See TracBrowser for help on using the repository browser.