regrtest.py 8.2 KB

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