# boost compilation regression test
# Usage: regrtest [*|compiler] [*|library/program]
#
# Default: regrtest * *
#
# Compilers: bcc54 = Borland 5.4
# bcc55 = Borland 5.5
# cw = Metrowerks CodeWarrior
# gcc = GNU GCC/egcs
# vc = Microsoft Visual C++
# vcstlport = Microsoft Visual C++ with STLport library
#
# Examples: regrtest
# regrtest
# regrtest gcc
# regrtest * smart_ptr/smart_ptr_test.cpp
# regrtest gcc smart_ptr/smart_ptr_test.cpp
#
# Note: use the following command line syntax if output is to be redirected:
# python regrtest.py [*|compiler] [*|library/program] >log 2>&1
# Revision history:
# 21 Jun 00 Redesign to allow specifying compiler and program (Beman Dawes)
# 18 Jun 00 Initial Version (Beman Dawes)
# The Metrowerks and Microsoft compilers require various environment variables be set.
# See mwcc -help
# See http://msdn.microsoft.com/library/devprods/vs6/visualc/vccore/_core_building_on_the_command_line.3a_.overview.htm
# Others:
# See bcb4.hlp. Don't bother with bcb4tools.hlp; it has a bad link to the command line options
import sys
import os
#------------------------------------------------------------------------------#
def invoke( desc, command ):
print " ", desc
f.write( "
" )
print " ", command #script debugging aid
sys.stdout.flush()
rs=os.system( command )
print " return status: ", rs
if rs==0:
f.write( "yes" )
else:
f.write( "no" )
f.write( " | \n" )
#------------------------------------------------------------------------------#
def compile( program ):
fullpath= path + "/libs/" + program
print
print "*****", program, "*****"
f.write( "\n" )
f.write( "" + program + " | \n" )
if compiler_arg=="*" or compiler_arg=="bcc54":
invoke( "Borland C++ 5.4", "\"" + bcc54_path + "/bcc32\" -I" + path + " -j10 -q " + fullpath )
if compiler_arg=="*" or compiler_arg=="bcc55":
invoke( "Borland C++ 5.5", "\"" + bcc55_path + "/bcc32\" -I" + path + " -j10 -q " + fullpath )
# GCC 2.95.2 is looping on some tests, so only invoke if asked for by name
#if compiler_arg=="*" or compiler_arg=="gcc":
if compiler_arg=="gcc":
# TODO: fix the absolute STLport paths
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" )
if compiler_arg=="*" or compiler_arg=="cw":
invoke( "Metrowerks CodeWarrior", "mwcc -maxerrors 10 -I- -I" + path + " " + fullpath )
#John Maddock says use /Zm400 switch; it increases compiler memory
if compiler_arg=="*" or compiler_arg=="vc":
invoke( "VC++ with MS library", 'cl /nologo /Zm400 /MDd /W3 /GR /GX /Zi /Od /GZ /I "' + path + '" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_CONSOLE" ' + fullpath )
if compiler_arg=="*" or compiler_arg=="vcstlport":
invoke( "VC++ with STLport library", 'cl /nologo /Zm400 /MDd /W3 /GR /GX /Zi /Od /GZ /I "' + stl + '" /I "' + path + '" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_CONSOLE" ' + fullpath )
f.write( "
\n" )
#------------------------------------------------------------------------------#
def library():
print
print "***** Boost Library *****"
f.write( "\n" )
f.write( "Boost library build | \n" )
#if compiler_arg=="*" or compiler_arg=="bcc32":
#if compiler_arg=="*" or compiler_arg=="gcc":
#if compiler_arg=="*" or compiler_arg=="cw":
#if compiler_arg=="*" or compiler_arg=="vc":
# command='cl /nologo /MDd /W3 /GR /GX /Zi /Od /GZ /I "' + path + '" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB /c"'
# command=command + " " + path + "/libs/" + ...
# invoke( "VC++ with MS library", command )
# 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' )
#if compiler_arg=="*" or compiler_arg=="vcstlport":
f.write( "
\n" )
#---------------------------------- main ------------------------------------#
# set up environment variables
path=os.environ["BOOST_PATH"]
table=os.environ["BOOST_TABLE"]
stl=os.environ["BOOST_STLPORT_PATH"]
bcc54_path=os.environ["BOOST_BCC54_PATH"]
bcc55_path=os.environ["BOOST_BCC55_PATH"]
compiler_arg="*"
if len(sys.argv)>1:
compiler_arg=sys.argv[1]
program_arg="*"
if len(sys.argv)>2:
program_arg=sys.argv[2]
f=open( table, "w" )
f.write( "\n" )
f.write( "\n" )
f.write( "Program | \n" )
if compiler_arg=="*" or compiler_arg=="bcc54":
f.write( "Borland BCC 5.4 | \n" )
if compiler_arg=="*" or compiler_arg=="bcc55":
f.write( "Borland BCC 5.5 | \n" )
# GCC 2.95.2 is looping on some tests, so only invoke if asked for by name
#if compiler_arg=="*" or compiler_arg=="gcc":
if compiler_arg=="gcc":
f.write( "GNU GCC 2.95.2 STLport 4.0 beta 8 | \n" )
if compiler_arg=="*" or compiler_arg=="cw":
f.write( "Metrowerks CodeWarrior 5.3 | \n" )
if compiler_arg=="*" or compiler_arg=="vc":
f.write( "Microsoft VC++ 6.0 SP3 | \n" )
if compiler_arg=="*" or compiler_arg=="vcstlport":
f.write( "Microsoft VC++ 6.0 SP3 STLport 3.2.1 | \n" )
f.write( "
\n" )
if program_arg=="*":
compile( "config/config_test.cpp" )
compile( "functional/function_test.cpp" )
compile( "integer/cstdint_test.cpp" )
compile( "integer/integer_test.cpp" )
compile( "integer/integer_traits_test.cpp" )
compile( "rational/rational_example.cpp" )
compile( "random/random_test.cpp" )
compile( "random/random_demo.cpp" )
compile( "smart_ptr/smart_ptr_test.cpp" )
# compile( "utility/algo_opt_examples.cpp" )
compile( "utility/call_traits_test.cpp" )
compile( "utility/cast_test.cpp" )
compile( "utility/iterators_test.cpp" )
compile( "utility/operators_test.cpp" )
compile( "utility/type_traits_test.cpp" )
else:
compile( program_arg )
f.write( "
\n" )
# end