| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged | 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged |
| 3 # Copyright (C) 2011 Apple Inc. All rights reserved. | 3 # Copyright (C) 2011 Apple Inc. All rights reserved. |
| 4 # | 4 # |
| 5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
| 6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
| 7 # met: | 7 # met: |
| 8 # | 8 # |
| 9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
| 10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 import os | 33 import os |
| 34 import sys | 34 import sys |
| 35 import traceback | 35 import traceback |
| 36 | 36 |
| 37 from webkitpy.common.host import Host | 37 from webkitpy.common.host import Host |
| 38 from webkitpy.layout_tests.controllers.manager import Manager | 38 from webkitpy.layout_tests.controllers.manager import Manager |
| 39 from webkitpy.layout_tests.models import test_run_results | 39 from webkitpy.layout_tests.models import test_run_results |
| 40 from webkitpy.layout_tests.port import configuration_options, platform_options | 40 from webkitpy.layout_tests.port import configuration_options, platform_options |
| 41 from webkitpy.layout_tests.views import buildbot_results | 41 from webkitpy.layout_tests.views import buildbot_results |
| 42 from webkitpy.layout_tests.views import printing | 42 from webkitpy.layout_tests.views import printing |
| 43 | 43 from webkitpy.layout_tests.generate_results_dashboard import GenerateDashBoard |
| 44 | 44 |
| 45 _log = logging.getLogger(__name__) | 45 _log = logging.getLogger(__name__) |
| 46 | 46 |
| 47 | 47 |
| 48 | 48 |
| 49 def main(argv, stdout, stderr): | 49 def main(argv, stdout, stderr): |
| 50 options, args = parse_args(argv) | 50 options, args = parse_args(argv) |
| 51 | 51 |
| 52 if options.platform and 'test' in options.platform: | 52 if options.platform and 'test' in options.platform: |
| 53 # It's a bit lame to import mocks into real code, but this allows the us
er | 53 # It's a bit lame to import mocks into real code, but this allows the us
er |
| (...skipping 16 matching lines...) Expand all Loading... |
| 70 return test_run_results.UNEXPECTED_ERROR_EXIT_STATUS | 70 return test_run_results.UNEXPECTED_ERROR_EXIT_STATUS |
| 71 | 71 |
| 72 try: | 72 try: |
| 73 run_details = run(port, options, args, stderr) | 73 run_details = run(port, options, args, stderr) |
| 74 if ((run_details.exit_code not in test_run_results.ERROR_CODES or | 74 if ((run_details.exit_code not in test_run_results.ERROR_CODES or |
| 75 run_details.exit_code == test_run_results.EARLY_EXIT_STATUS) and | 75 run_details.exit_code == test_run_results.EARLY_EXIT_STATUS) and |
| 76 not run_details.initial_results.keyboard_interrupted): | 76 not run_details.initial_results.keyboard_interrupted): |
| 77 bot_printer = buildbot_results.BuildBotPrinter(stdout, options.debug
_rwt_logging) | 77 bot_printer = buildbot_results.BuildBotPrinter(stdout, options.debug
_rwt_logging) |
| 78 bot_printer.print_results(run_details) | 78 bot_printer.print_results(run_details) |
| 79 | 79 |
| 80 if options.enable_versioned_results: |
| 81 gen_dash_board = GenerateDashBoard(port) |
| 82 gen_dash_board.generate() |
| 83 |
| 80 return run_details.exit_code | 84 return run_details.exit_code |
| 85 |
| 81 # We need to still handle KeyboardInterrupt, atleast for webkitpy unittest c
ases. | 86 # We need to still handle KeyboardInterrupt, atleast for webkitpy unittest c
ases. |
| 82 except KeyboardInterrupt: | 87 except KeyboardInterrupt: |
| 83 return test_run_results.INTERRUPTED_EXIT_STATUS | 88 return test_run_results.INTERRUPTED_EXIT_STATUS |
| 84 except test_run_results.TestRunException as e: | 89 except test_run_results.TestRunException as e: |
| 85 print >> stderr, e.msg | 90 print >> stderr, e.msg |
| 86 return e.code | 91 return e.code |
| 87 except BaseException as e: | 92 except BaseException as e: |
| 88 if isinstance(e, Exception): | 93 if isinstance(e, Exception): |
| 89 print >> stderr, '\n%s raised: %s' % (e.__class__.__name__, str(e)) | 94 print >> stderr, '\n%s raised: %s' % (e.__class__.__name__, str(e)) |
| 90 traceback.print_exc(file=stderr) | 95 traceback.print_exc(file=stderr) |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 help="Use the specified port's baselines first"), | 164 help="Use the specified port's baselines first"), |
| 160 optparse.make_option("--no-show-results", action="store_false", | 165 optparse.make_option("--no-show-results", action="store_false", |
| 161 default=True, dest="show_results", | 166 default=True, dest="show_results", |
| 162 help="Don't launch a browser with results after the tests " | 167 help="Don't launch a browser with results after the tests " |
| 163 "are done"), | 168 "are done"), |
| 164 optparse.make_option("--full-results-html", action="store_true", | 169 optparse.make_option("--full-results-html", action="store_true", |
| 165 default=False, | 170 default=False, |
| 166 help="Show all failures in results.html, rather than only regression
s"), | 171 help="Show all failures in results.html, rather than only regression
s"), |
| 167 optparse.make_option("--clobber-old-results", action="store_true", | 172 optparse.make_option("--clobber-old-results", action="store_true", |
| 168 default=False, help="Clobbers test results from previous runs."), | 173 default=False, help="Clobbers test results from previous runs."), |
| 174 optparse.make_option("--enable-versioned-results", action="store_true", |
| 175 default=False, help="Archive the test results for later access."), |
| 169 optparse.make_option("--smoke", action="store_true", | 176 optparse.make_option("--smoke", action="store_true", |
| 170 help="Run just the SmokeTests"), | 177 help="Run just the SmokeTests"), |
| 171 optparse.make_option("--no-smoke", dest="smoke", action="store_false", | 178 optparse.make_option("--no-smoke", dest="smoke", action="store_false", |
| 172 help="Do not run just the SmokeTests"), | 179 help="Do not run just the SmokeTests"), |
| 173 ])) | 180 ])) |
| 174 | 181 |
| 175 option_group_definitions.append(("Testing Options", [ | 182 option_group_definitions.append(("Testing Options", [ |
| 176 optparse.make_option("--build", dest="build", | 183 optparse.make_option("--build", dest="build", |
| 177 action="store_true", default=True, | 184 action="store_true", default=True, |
| 178 help="Check to ensure the build is up-to-date (default)."), | 185 help="Check to ensure the build is up-to-date (default)."), |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 printer.print_config(port.results_directory()) | 380 printer.print_config(port.results_directory()) |
| 374 | 381 |
| 375 run_details = manager.run(args) | 382 run_details = manager.run(args) |
| 376 _log.debug("Testing completed, Exit status: %d" % run_details.exit_code) | 383 _log.debug("Testing completed, Exit status: %d" % run_details.exit_code) |
| 377 return run_details | 384 return run_details |
| 378 finally: | 385 finally: |
| 379 printer.cleanup() | 386 printer.cleanup() |
| 380 | 387 |
| 381 if __name__ == '__main__': | 388 if __name__ == '__main__': |
| 382 sys.exit(main(sys.argv[1:], sys.stdout, sys.stderr)) | 389 sys.exit(main(sys.argv[1:], sys.stdout, sys.stderr)) |
| OLD | NEW |