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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 try: | 72 try: |
73 port = host.port_factory.get(options.platform, options) | 73 port = host.port_factory.get(options.platform, options) |
74 except NotImplementedError, e: | 74 except NotImplementedError, e: |
75 # FIXME: is this the best way to handle unsupported port names? | 75 # FIXME: is this the best way to handle unsupported port names? |
76 print >> stderr, str(e) | 76 print >> stderr, str(e) |
77 return EXCEPTIONAL_EXIT_STATUS | 77 return EXCEPTIONAL_EXIT_STATUS |
78 | 78 |
79 try: | 79 try: |
80 run_details = run(port, options, args, stderr) | 80 run_details = run(port, options, args, stderr) |
81 if run_details.exit_code != -1: | 81 if run_details.exit_code != -1 and not run_details.initial_results.keybo
ard_interrupted: |
82 bot_printer = buildbot_results.BuildBotPrinter(stdout, options.debug
_rwt_logging) | 82 bot_printer = buildbot_results.BuildBotPrinter(stdout, options.debug
_rwt_logging) |
83 bot_printer.print_results(run_details) | 83 bot_printer.print_results(run_details) |
84 | 84 |
85 return run_details.exit_code | 85 return run_details.exit_code |
| 86 # We need to still handle KeyboardInterrupt, atleast for webkitpy unittest c
ases. |
86 except KeyboardInterrupt: | 87 except KeyboardInterrupt: |
87 return INTERRUPTED_EXIT_STATUS | 88 return INTERRUPTED_EXIT_STATUS |
88 except BaseException as e: | 89 except BaseException as e: |
89 if isinstance(e, Exception): | 90 if isinstance(e, Exception): |
90 print >> stderr, '\n%s raised: %s' % (e.__class__.__name__, str(e)) | 91 print >> stderr, '\n%s raised: %s' % (e.__class__.__name__, str(e)) |
91 traceback.print_exc(file=stderr) | 92 traceback.print_exc(file=stderr) |
92 return EXCEPTIONAL_EXIT_STATUS | 93 return EXCEPTIONAL_EXIT_STATUS |
93 | 94 |
94 | 95 |
95 def parse_args(args): | 96 def parse_args(args): |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 printer.print_config(port.results_directory()) | 348 printer.print_config(port.results_directory()) |
348 | 349 |
349 run_details = manager.run(args) | 350 run_details = manager.run(args) |
350 _log.debug("Testing completed, Exit status: %d" % run_details.exit_code) | 351 _log.debug("Testing completed, Exit status: %d" % run_details.exit_code) |
351 return run_details | 352 return run_details |
352 finally: | 353 finally: |
353 printer.cleanup() | 354 printer.cleanup() |
354 | 355 |
355 if __name__ == '__main__': | 356 if __name__ == '__main__': |
356 sys.exit(main(sys.argv[1:], sys.stdout, sys.stderr)) | 357 sys.exit(main(sys.argv[1:], sys.stdout, sys.stderr)) |
OLD | NEW |