generate_test_results.py 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #
  2. # Generates test test results for testing of boost_wide_report.py
  3. #
  4. import common
  5. import xml.sax.saxutils
  6. import os
  7. import time
  8. num_of_libs = 5
  9. num_of_runners = 5
  10. num_of_toolsets = 3
  11. num_of_tests = 10
  12. results_directory = "results/incoming/CVS-HEAD/processed"
  13. # Generated results follow the rules:
  14. #
  15. # * odd runners are testing on Win32, even runners are testin on Unix
  16. # * the third toolset has 2 variants
  17. #
  18. # Generated expected markup:
  19. #
  20. # * First two toolset are required
  21. # * Every fourth library is unusable on event toolsets
  22. # * Last two tests are corner-ase tests
  23. # * Every 4th test is explicitly marked up as expected-failure
  24. def library_build_failed( library_idx ):
  25. return library_idx % 2
  26. def test_run_source( runner_idx ):
  27. if runner_idx % 2: return "tarball"
  28. else: return "cvs head"
  29. def test_run_type( runner_idx ):
  30. if runner_idx % 2: return "incremental"
  31. else: return "full"
  32. def test_type( i ):
  33. types = [ "compile", "compile_fail", "link", "link_fail", "run", "run_fail", "run_pyd" ]
  34. return types[ i % len( types) ]
  35. def make_test_results():
  36. if not os.path.exists( results_directory ):
  37. os.makedirs( results_directory )
  38. for i_runner in range( 0, num_of_runners ):
  39. runner_id = "runner %02d" % i_runner
  40. g = xml.sax.saxutils.XMLGenerator( open( os.path.join( results_directory, runner_id + ".xml" ), "w" ), "utf-8" )
  41. g.startDocument()
  42. if i_runner % 2:
  43. platform = "Win32"
  44. else:
  45. platform = "Unix"
  46. g.startElement( "test-run", { "platform": platform
  47. , "runner": runner_id
  48. , "timestamp": common.format_timestamp(
  49. time.gmtime( time.time() - i_runner * 24*60*60 )
  50. )
  51. , "revision": '%d' % ( 7000 + i_runner )
  52. , "source": test_run_source( i_runner )
  53. , "run-type": test_run_type( i_runner )
  54. } )
  55. g.startElement( "comment", {} )
  56. g.characters( "<b>Runner</b> is who <i>running</i> does." )
  57. g.endElement( "comment" )
  58. for i_lib in range( 0, num_of_libs ):
  59. for i_toolset in range( num_of_toolsets ):
  60. if library_build_failed( i_lib ): test_result = "fail"
  61. else: test_result = "success"
  62. common.make_test_log( xml_generator = g
  63. , library_idx = i_lib
  64. , toolset_idx = i_toolset
  65. , test_name = ""
  66. , test_type = "lib"
  67. , test_result = test_result
  68. , show_run_output = "false"
  69. , variant = None )
  70. for i_lib in range( 0, num_of_libs ):
  71. library_name = "library_%02d" % i_lib
  72. if num_of_runners - 1 == i_runner and i_lib % 2:
  73. continue
  74. for i_toolset in range( num_of_toolsets ):
  75. toolset_name = "toolset %02d" % ( i_toolset )
  76. if num_of_runners - 1 == i_runner and i_toolset % 2:
  77. continue
  78. for i_test in range( num_of_tests ):
  79. test_name = "test_%02d_%02d" % ( i_lib, i_test )
  80. test_result = ""
  81. show_run_output = "false"
  82. if num_of_runners - 1 == i_runner and i_test % 2:
  83. continue
  84. if i_runner % 2: test_result = "success"
  85. else: test_result = "fail"
  86. if i_runner == 1 and i_toolset == 2 and i_test % 6 == 0:
  87. test_result = "fail"
  88. if test_result == "success" and ( 0 == i_test % 5 ):
  89. show_run_output = "true"
  90. if i_toolset == 2:
  91. variants = [ "static-lib", "shared-lib" ]
  92. else:
  93. variants = [ None ]
  94. for variant in variants:
  95. common.make_test_log( xml_generator = g
  96. , library_idx = i_lib
  97. , toolset_idx = i_toolset
  98. , test_name = test_name
  99. , test_type = test_type( i_test )
  100. , test_result = test_result
  101. , show_run_output = show_run_output
  102. , variant = variant )
  103. g.endElement( "test-run" )
  104. g.endDocument()
  105. ## <test-log library="algorithm" test-name="container" test-type="run" test-program="libs/algorithm/string/test/container_test.cpp" target-directory="bin/boost/libs/algorithm/string/test/container.test/borland-5.6.4/debug" toolset="borland-5.6.4" show-run-output="false">
  106. ## <compile result="fail" timestamp="2004-06-29 17:02:27 UTC">
  107. ## "C:\Progra~1\Borland\CBuilder6\bin\bcc32" -j5 -g255 -q -c -P -w -Ve -Vx -a8 -b- -v -Od -vi- -tWC -tWR -tWC -WM- -DBOOST_ALL_NO_LIB=1 -w-8001 -I"C:\Users\Administrator\boost\main\results\bin\boost\libs\algorithm\string\test" -I"C:\Users\Administrator\boost\main\boost" -I"C:\Progra~1\Borland\CBuilder6\include" -o"C:\Users\Administrator\boost\main\results\bin\boost\libs\algorithm\string\test\container.test\borland-5.6.4\debug\container_test.obj" "..\libs\algorithm\string\test\container_test.cpp"
  108. ## ..\libs\algorithm\string\test\container_test.cpp:
  109. ## Warning W8091 C:\Users\Administrator\boost\main\boost\libs/test/src/unit_test_result.cpp 323: template argument _InputIter passed to 'for_each' is a output iterator: input iterator required in function unit_test_result::~unit_test_result()
  110. ## Warning W8091 C:\Users\Administrator\boost\main\boost\libs/test/src/unit_test_suite.cpp 63: template argument _InputIter passed to 'find_if' is a output iterator: input iterator required in function test_case::Impl::check_dependencies()
  111. ## Warning W8091 C:\Users\Administrator\boost\main\boost\libs/test/src/unit_test_suite.cpp 204: template argument _InputIter passed to 'for_each' is a output iterator: input iterator required in function test_suite::~test_suite()
  112. ## Error E2401 C:\Users\Administrator\boost\main\boost\boost/algorithm/string/finder.hpp 45: Invalid template argument list
  113. ## Error E2040 C:\Users\Administrator\boost\main\boost\boost/algorithm/string/finder.hpp 46: Declaration terminated incorrectly
  114. ## Error E2090 C:\Users\Administrator\boost\main\boost\boost/algorithm/string/finder.hpp 277: Qualifier 'algorithm' is not a class or namespace name
  115. ## Error E2272 C:\Users\Administrator\boost\main\boost\boost/algorithm/string/finder.hpp 277: Identifier expected
  116. ## Error E2090 C:\Users\Administrator\boost\main\boost\boost/algorithm/string/finder.hpp 278: Qualifier 'algorithm' is not a class or namespace name
  117. ## Error E2228 C:\Users\Administrator\boost\main\boost\boost/algorithm/string/finder.hpp 278: Too many error or warning messages
  118. ## *** 6 errors in Compile ***
  119. ## </compile>
  120. ## </test-log>
  121. make_test_results()
  122. common.make_expicit_failure_markup( num_of_libs, num_of_toolsets, num_of_tests )
粤ICP备19079148号