regrtest.py 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. #!/usr/bin/python
  2. # boost compilation regression test
  3. # Usage: regrtest [*|compiler] [*|library/program]
  4. #
  5. # Default: regrtest * *
  6. #
  7. # Compilers: bcc54 = Borland 5.4
  8. # bcc55 = Borland 5.5.1
  9. # cw = Metrowerks CodeWarrior
  10. # gcc = GNU GCC/egcs
  11. # como = Comeau C++
  12. # vc = Microsoft Visual C++
  13. # vcstlport = Microsoft Visual C++ with STLport library
  14. #
  15. # Examples: regrtest
  16. # regrtest
  17. # regrtest gcc
  18. # regrtest * smart_ptr/smart_ptr_test.cpp
  19. # regrtest gcc smart_ptr/smart_ptr_test.cpp
  20. #
  21. # Note: use the following command line syntax if output is to be redirected:
  22. # python regrtest.py [*|compiler] [*|library/program] >log 2>&1
  23. # Revision history:
  24. # 21 Jun 00 Redesign to allow specifying compiler and program (Beman Dawes)
  25. # 18 Jun 00 Initial Version (Beman Dawes)
  26. # The Metrowerks and Microsoft compilers require various environment variables be set.
  27. # See mwcc -help
  28. # See http://msdn.microsoft.com/library/devprods/vs6/visualc/vccore/_core_building_on_the_command_line.3a_.overview.htm
  29. # Others:
  30. # See bcb4.hlp. Don't bother with bcb4tools.hlp; it has a bad link to the command line options
  31. import sys
  32. import os
  33. import time
  34. #------------------------------------------------------------------------------#
  35. def invoke( desc, command ):
  36. print " ", desc
  37. f.write( "<td>" )
  38. print " ", command #script debugging aid
  39. sys.stdout.flush()
  40. rs=os.system( command )
  41. print " return status: ", rs
  42. if rs==0:
  43. f.write( "yes" )
  44. else:
  45. f.write( "no" )
  46. f.write( "</td>\n" )
  47. #------------------------------------------------------------------------------#
  48. def compile( program ):
  49. fullpath= path + "/libs/" + program
  50. print
  51. print "*****", program, "*****"
  52. f.write( "<tr>\n" )
  53. f.write( "<td><a href=\"" + program + "\">" + program + "</a></td>\n" )
  54. if sys.platform == "linux2":
  55. if compiler_arg == "*" or compiler_arg == "gcc":
  56. invoke( "GCC 2.95.2", 'g++ -ftemplate-depth-30 -I' + path + ' ' + fullpath )
  57. if compiler_arg == "*" or compiler_arg == "gcc-stlport":
  58. invoke( "GCC 2.95.2 STLport 4.0", 'g++ -V 2.95.2-stlport -ftemplate-depth-30 -I' + path + ' ' + fullpath )
  59. # if compiler_arg == "*" or compiler_arg == "gcc-exp":
  60. # invoke( "GCC pre-2.96 experimental", '/opt/exp/gcc/bin/g++ -ftemplate-depth-30 -I' + path + ' ' + fullpath )
  61. if compiler_arg == "*" or compiler_arg == "como":
  62. invoke( "Comeau C++ 4.2.44 beta3", 'como -I' + path + ' ' + fullpath)
  63. else:
  64. if compiler_arg=="*" or compiler_arg=="bcc54":
  65. bcc54_path=os.environ["BOOST_BCC54_PATH"]
  66. invoke( "Borland C++ 5.4 up2", "\"" + bcc54_path + "/bcc32\" -I" + path + " -j10 -q " + fullpath )
  67. if compiler_arg=="*" or compiler_arg=="bcc55":
  68. bcc55_path=os.environ["BOOST_BCC55_PATH"]
  69. invoke( "Borland C++ 5.5.1", "\"" + bcc55_path + "/bcc32\" -I" + path + " -j10 -q " + fullpath )
  70. # GCC 2.95.2 is looping on some tests, so only invoke if asked for by name
  71. #if compiler_arg=="*" or compiler_arg=="gcc":
  72. if compiler_arg=="gcc":
  73. # TODO: fix the absolute STLport paths
  74. 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" )
  75. if compiler_arg=="*" or compiler_arg=="cw":
  76. invoke( "Metrowerks CodeWarrior", "mwcc -maxerrors 10 -cwd source -I- -I" + path + " " + fullpath )
  77. #John Maddock says use /Zm400 switch; it increases compiler memory
  78. if compiler_arg=="*" or compiler_arg=="vc":
  79. 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 )
  80. if compiler_arg=="*" or compiler_arg=="vcstlport":
  81. stl=os.environ["BOOST_STLPORT_PATH"]
  82. 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 )
  83. f.write( "</tr>\n" )
  84. #------------------------------------------------------------------------------#
  85. def library():
  86. print
  87. print "***** Boost Library *****"
  88. f.write( "<tr>\n" )
  89. f.write( "<td>Boost library build</td>\n" )
  90. #if compiler_arg=="*" or compiler_arg=="bcc32":
  91. #if compiler_arg=="*" or compiler_arg=="gcc":
  92. #if compiler_arg=="*" or compiler_arg=="cw":
  93. #if compiler_arg=="*" or compiler_arg=="vc":
  94. # command='cl /nologo /MDd /W3 /GR /GX /Zi /Od /GZ /I "' + path + '" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB /c"'
  95. # command=command + " " + path + "/libs/" + ...
  96. # invoke( "VC++ with MS library", command )
  97. # 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' )
  98. #if compiler_arg=="*" or compiler_arg=="vcstlport":
  99. f.write( "</tr>\n" )
  100. #---------------------------------- main ------------------------------------#
  101. # set up environment variables
  102. path=os.environ["BOOST_PATH"]
  103. compiler_arg="*"
  104. if len(sys.argv)>1:
  105. compiler_arg=sys.argv[1]
  106. program_arg="*"
  107. if len(sys.argv)>2:
  108. program_arg=sys.argv[2]
  109. if sys.platform == "linux2":
  110. platform = "Linux/x86"
  111. elif sys.platform == "win32":
  112. platform = "Windows"
  113. if os.name == "nt":
  114. platform = platform + " NT / Windows 2000"
  115. else:
  116. print "**** Error: unknown platform ****"
  117. sys.exit(1)
  118. f=open( "cs-" + sys.platform + ".html", "w" )
  119. f.write( "<html>\n<head>\n<title>\nCompiler Status: " + platform + "\n</title>\n</head>" )
  120. f.write( "<body bgcolor=\"#FFFFFF\" text=\"#000000\">\n" )
  121. f.write( "<h1><img border=\"0\" src=\"../c++boost.gif\" width=\"277\" height=\"86\"></h1>\n" )
  122. f.write( "<h1>Compiler Status: " + platform + "</h1>\n" )
  123. f.write( "<p><b>Run Date:</b> " + time.strftime("%d %b %Y GMT", time.gmtime(time.time())) + "</p>\n" )
  124. f.write( "<p>\n" )
  125. f.write( "<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n" )
  126. f.write( "<tr>\n" )
  127. f.write( "<td>Program</td>\n" )
  128. if sys.platform == "linux2":
  129. if compiler_arg == "*" or compiler_arg == "gcc":
  130. f.write( "<td>GNU<br>GCC<br>2.95.2</td>\n" )
  131. if compiler_arg == "*" or compiler_arg == "gcc-stlport":
  132. f.write( "<td>GNU<br>GCC<br>2.95.2<br>STLport<br>4.0</td>\n" )
  133. # if compiler_arg == "*" or compiler_arg == "gcc-exp":
  134. # f.write( "<td>GNU<br>GCC<br>pre-2.96 experimental</td>\n" )
  135. if compiler_arg == "*" or compiler_arg == "como":
  136. f.write( "<td>Comeau C++<br>4.2.44 beta3<br>STLport<br>4.0</td>\n" )
  137. else:
  138. if compiler_arg=="*" or compiler_arg=="bcc54":
  139. f.write( "<td>Borland<br>BCC<br>5.4 up2</td>\n" )
  140. if compiler_arg=="*" or compiler_arg=="bcc55":
  141. f.write( "<td>Borland<br>BCC<br>5.5.1</td>\n" )
  142. # GCC 2.95.2 is looping on some tests, so only invoke if asked for by name
  143. #if compiler_arg=="*" or compiler_arg=="gcc":
  144. if compiler_arg=="gcc":
  145. f.write( "<td>GNU<br>GCC<br>2.95.2<br>STLport<br>4.0 beta 8</td>\n" )
  146. if compiler_arg=="*" or compiler_arg=="cw":
  147. f.write( "<td>Metrowerks<br>CodeWarrior<br>5.3</td>\n" )
  148. if compiler_arg=="*" or compiler_arg=="vc":
  149. f.write( "<td>Microsoft<br>VC++<br>6.0 SP3</td>\n" )
  150. if compiler_arg=="*" or compiler_arg=="vcstlport":
  151. f.write( "<td>Microsoft<br>VC++<br>6.0 SP3<br>STLport<br>3.2.1</td>\n" )
  152. f.write( "</tr>\n" )
  153. if program_arg=="*":
  154. compile( "config/config_test.cpp" )
  155. compile( "array/array1.cpp" )
  156. # compile( "compose/compose1.cpp" )
  157. compile( "functional/function_test.cpp" )
  158. compile( "integer/cstdint_test.cpp" )
  159. compile( "integer/integer_test.cpp" )
  160. compile( "integer/integer_traits_test.cpp" )
  161. compile( "rational/rational_example.cpp" )
  162. compile( "random/random_test.cpp" )
  163. compile( "random/random_demo.cpp" )
  164. compile( "smart_ptr/smart_ptr_test.cpp" )
  165. # compile( "utility/algo_opt_examples.cpp" )
  166. compile( "utility/call_traits_test.cpp" )
  167. compile( "utility/cast_test.cpp" )
  168. compile( "utility/compressed_pair_test.cpp" )
  169. compile( "utility/iterators_test.cpp" )
  170. compile( "utility/operators_test.cpp" )
  171. compile( "utility/type_traits_test.cpp" )
  172. else:
  173. compile( program_arg )
  174. f.write( "</table>\n</body>\n</html>\n" )
  175. # end
粤ICP备19079148号