regrtest.py 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. #!/usr/bin/python
  2. # boost compilation regression test
  3. # Usage: regrtest [*|compiler] [*|library/program]
  4. #
  5. # Default: regrtest * *
  6. #
  7. # Compilers: bcc = Borland 5.5.1
  8. # cw = Metrowerks CodeWarrior
  9. # gcc = GNU GCC
  10. # gcc-stlport = GNU GCC with STLport library
  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. # ---------- Linux2 ---------- #
  55. if sys.platform == "linux2":
  56. if compiler_arg == "*" or compiler_arg == "gcc":
  57. invoke( "GCC 2.95.2", 'g++ -ftemplate-depth-30 -c -I' + path + ' ' + fullpath )
  58. if compiler_arg == "*" or compiler_arg == "gcc-stlport":
  59. invoke( "GCC 2.95.2 STLport 4.0", 'g++ -V 2.95.2-stlport -c -ftemplate-depth-30 -I' + path + ' ' + fullpath )
  60. # if compiler_arg == "*" or compiler_arg == "gcc-exp":
  61. # invoke( "GCC pre-2.97 experimental", '/opt/exp/gcc/bin/g++ -ftemplate-depth-30 -I' + path + ' ' + fullpath )
  62. if compiler_arg == "*" or compiler_arg == "como":
  63. invoke( "Comeau C++ 4.2.44 beta3", 'como -c -I' + path + ' ' + fullpath)
  64. # if compiler_arg == "*" or compiler_arg == "occ":
  65. # invoke( "OpenC++ 2.5.9", 'occ -c --regular-c++ -I' + path + ' ' + fullpath)
  66. # ----------- BeOS5/Intel ------ #
  67. #
  68. # currently this compiler fails so many tests that it may not be worth while
  69. # reporting the results: most of these are as a result of broken C++ standard
  70. # libraries and a non-standard <climits>, problems that the forthcoming
  71. # gcc3 should fix (STLPort does not build on this platform).
  72. #
  73. elif sys.platform == "beos":
  74. if compiler_arg=="*" or compiler_arg=="gcc":
  75. invoke( "GNU GCC", "c++ -ftemplate-depth-30 -Wall -I" + path + " " + fullpath )
  76. if compiler_arg=="*" or compiler_arg=="gcc-sgi":
  77. invoke( "GNU GCC", "c++ -ftemplate-depth-30 -Wall -I/boot/home/config/stlport/stl330 -I" + path + " " + fullpath )
  78. # ---------- Windows ---------- #
  79. else:
  80. # if compiler_arg=="*" or compiler_arg=="bcc54":
  81. # bcc54_path=os.environ["BOOST_BCC54_PATH"]
  82. # invoke( "Borland C++ 5.4 up2", "\"" + bcc54_path + "/bcc32\" -I" + path + " -j10 -q " + fullpath )
  83. if compiler_arg=="*" or compiler_arg=="bcc":
  84. bcc55_path=os.environ["BOOST_BCC55_PATH"]
  85. invoke( "Borland C++ 5.5.1", "\"" + bcc55_path + "/bcc32\" -I" + path + " -j10 -q " + fullpath )
  86. # GCC 2.95.2 is looping on some tests, so only invoke if asked for by name
  87. #if compiler_arg=="*" or compiler_arg=="gcc":
  88. if compiler_arg=="gcc":
  89. # TODO: fix the absolute STLport paths
  90. 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" )
  91. if compiler_arg=="*" or compiler_arg=="cw":
  92. invoke( "Metrowerks CodeWarrior", "mwcc -maxerrors 10 -cwd source -I- -I" + path + " " + fullpath )
  93. #John Maddock says use /Zm400 switch; it increases compiler memory
  94. if compiler_arg=="*" or compiler_arg=="vc":
  95. invoke( "VC++ with MS library", 'cl /c /nologo /Zm400 /MDd /W3 /GR /GX /Zi /Od /GZ /I "' + path + '" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_CONSOLE" ' + fullpath )
  96. if compiler_arg=="*" or compiler_arg=="vcstlport":
  97. stl=os.environ["BOOST_STLPORT_PATH"]
  98. invoke( "VC++ with STLport library", 'cl /c /nologo /Zm400 /MDd /W3 /GR /GX /Zi /Od /GZ /I "' + stl + '" /I "' + path + '" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_CONSOLE" ' + fullpath )
  99. f.write( "</tr>\n" )
  100. #------------------------------------------------------------------------------#
  101. def library():
  102. print
  103. print "***** Boost Library *****"
  104. f.write( "<tr>\n" )
  105. f.write( "<td>Boost library build</td>\n" )
  106. #if compiler_arg=="*" or compiler_arg=="bcc32":
  107. #if compiler_arg=="*" or compiler_arg=="gcc":
  108. #if compiler_arg=="*" or compiler_arg=="cw":
  109. #if compiler_arg=="*" or compiler_arg=="vc":
  110. # command='cl /nologo /MDd /W3 /GR /GX /Zi /Od /GZ /I "' + path + '" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB /c"'
  111. # command=command + " " + path + "/libs/" + ...
  112. # invoke( "VC++ with MS library", command )
  113. # 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' )
  114. #if compiler_arg=="*" or compiler_arg=="vcstlport":
  115. f.write( "</tr>\n" )
  116. #---------------------------------- main ------------------------------------#
  117. # set up environment variables
  118. path=os.environ["BOOST_PATH"]
  119. compiler_arg="*"
  120. if len(sys.argv)>1:
  121. compiler_arg=sys.argv[1]
  122. program_arg="*"
  123. if len(sys.argv)>2:
  124. program_arg=sys.argv[2]
  125. if sys.platform == "linux2":
  126. platform = "Linux/x86"
  127. elif sys.platform == "beos":
  128. platform = "BeOS5/x86"
  129. elif sys.platform == "win32":
  130. platform = "Windows"
  131. if os.name == "nt":
  132. platform = platform + " NT / Windows 2000"
  133. else:
  134. print "**** Error: unknown platform ****"
  135. sys.exit(1)
  136. f=open( "cs-" + sys.platform + ".html", "w" )
  137. f.write( "<html>\n<head>\n<title>\nCompiler Status: " + platform + "\n</title>\n</head>" )
  138. f.write( "<body bgcolor=\"#FFFFFF\" text=\"#000000\">\n" )
  139. f.write( "<h1><img border=\"0\" src=\"../c++boost.gif\" width=\"277\" height=\"86\"></h1>\n" )
  140. f.write( "<h1>Compiler Status: " + platform + "</h1>\n" )
  141. f.write( "<p><b>Run Date:</b> " + time.strftime("%d %b %Y %H:%M GMT", time.gmtime(time.time())) + "</p>\n" )
  142. f.write( "<p>\n" )
  143. f.write( "<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n" )
  144. f.write( "<tr>\n" )
  145. f.write( "<td>Program</td>\n" )
  146. if sys.platform == "linux2":
  147. if compiler_arg == "*" or compiler_arg == "gcc":
  148. f.write( "<td>GNU<br>GCC<br>2.95.2</td>\n" )
  149. if compiler_arg == "*" or compiler_arg == "gcc-stlport":
  150. f.write( "<td>GNU<br>GCC<br>2.95.2<br>STLport<br>4.0</td>\n" )
  151. # if compiler_arg == "*" or compiler_arg == "gcc-exp":
  152. # f.write( "<td>GNU<br>GCC<br>pre-2.97 experimental</td>\n" )
  153. if compiler_arg == "*" or compiler_arg == "como":
  154. f.write( "<td>Comeau C++<br>4.2.44 beta3<br>STLport<br>4.0</td>\n" )
  155. # if compiler_arg == "*" or compiler_arg == "occ":
  156. # f.write( "<td>OpenC++<br>2.5.9</td>\n" )
  157. elif sys.platform == "beos":
  158. if compiler_arg == "*" or compiler_arg == "gcc":
  159. f.write( "<td>GNUPro<br>GCC&nbsp;2.9</td>\n" )
  160. if compiler_arg == "*" or compiler_arg == "gcc-sgi":
  161. f.write( "<td>GNUPro<br>GCC&nbsp;2.9<br>+<br>SGI&nbsp;STL&nbsp;3.3</td>\n" )
  162. else:
  163. # if compiler_arg=="*" or compiler_arg=="bcc54":
  164. # f.write( "<td>Borland<br>BCC<br>5.4 up2</td>\n" )
  165. if compiler_arg=="*" or compiler_arg=="bcc":
  166. f.write( "<td>Borland<br>BCC<br>5.5.1</td>\n" )
  167. # GCC 2.95.2 is looping on some tests, so only invoke if asked for by name
  168. #if compiler_arg=="*" or compiler_arg=="gcc":
  169. if compiler_arg=="gcc":
  170. f.write( "<td>GNU<br>GCC<br>2.95.2<br>STLport<br>4.0 beta 8</td>\n" )
  171. if compiler_arg=="*" or compiler_arg=="cw":
  172. f.write( "<td>Metrowerks<br>CodeWarrior<br>6.0</td>\n" )
  173. if compiler_arg=="*" or compiler_arg=="vc":
  174. f.write( "<td>Microsoft<br>VC++<br>6.0 SP4</td>\n" )
  175. if compiler_arg=="*" or compiler_arg=="vcstlport":
  176. f.write( "<td>Microsoft<br>VC++<br>6.0 SP4<br>STLport<br>4.0</td>\n" )
  177. f.write( "</tr>\n" )
  178. if program_arg=="*":
  179. compile( "config/config_test.cpp" )
  180. compile( "array/array1.cpp" )
  181. # compile( "compose/compose1.cpp" )
  182. compile( "functional/function_test.cpp" )
  183. compile( "graph/test/graph.cpp" )
  184. compile( "integer/cstdint_test.cpp" )
  185. compile( "integer/integer_test.cpp" )
  186. compile( "integer/integer_traits_test.cpp" )
  187. compile( "rational/rational_example.cpp" )
  188. compile( "random/random_test.cpp" )
  189. compile( "random/random_demo.cpp" )
  190. compile( "regex/demo/regress/regex_test.cpp" )
  191. compile( "regex/demo/regress/wregex_test.cpp" )
  192. compile( "smart_ptr/smart_ptr_test.cpp" )
  193. compile( "static_assert/static_assert_test.cpp" )
  194. # compile( "utility/algo_opt_examples.cpp" )
  195. compile( "utility/call_traits_test.cpp" )
  196. compile( "utility/cast_test.cpp" )
  197. compile( "utility/compressed_pair_test.cpp" )
  198. compile( "utility/iterator_adaptor_test.cpp" )
  199. compile( "utility/iterators_test.cpp" )
  200. compile( "utility/operators_test.cpp" )
  201. compile( "utility/tie_example.cpp" )
  202. compile( "utility/type_traits_test.cpp" )
  203. else:
  204. compile( program_arg )
  205. f.write( "</table>\n" );
  206. if sys.platform == "linux2":
  207. f.write( "<p>\nNote: A hand-crafted &lt;limits&gt; Standard header has been applied to all configurations.\n" )
  208. f.write( "</body>\n</html>\n" )
  209. # end
粤ICP备19079148号