Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

Issue 23496003: User interruption should still create results.html for run-webkit-tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review comments incorporated Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 28 matching lines...) Expand all
39 from webkitpy.layout_tests.controllers.manager import Manager 39 from webkitpy.layout_tests.controllers.manager import Manager
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
44 44
45 _log = logging.getLogger(__name__) 45 _log = logging.getLogger(__name__)
46 46
47 47
48 # This mirrors what the shell normally does. 48 # This mirrors what the shell normally does.
49 INTERRUPTED_EXIT_STATUS = signal.SIGINT + 128 49 INTERRUPTED_EXIT_STATUS = signal.SIGINT + 128
Dirk Pranke 2013/08/29 17:04:26 You can delete this line (and the 'import signal,
50 50
51 # This is a randomly chosen exit code that can be tested against to 51 # This is a randomly chosen exit code that can be tested against to
52 # indicate that an unexpected exception occurred. 52 # indicate that an unexpected exception occurred.
53 EXCEPTIONAL_EXIT_STATUS = 254 53 EXCEPTIONAL_EXIT_STATUS = 254
54 54
55 55
56 def main(argv, stdout, stderr): 56 def main(argv, stdout, stderr):
57 options, args = parse_args(argv) 57 options, args = parse_args(argv)
58 58
59 if options.platform and 'test' in options.platform: 59 if options.platform and 'test' in options.platform:
(...skipping 16 matching lines...) Expand all
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:
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 except KeyboardInterrupt:
87 return INTERRUPTED_EXIT_STATUS
88 except BaseException as e: 86 except BaseException as e:
89 if isinstance(e, Exception): 87 if isinstance(e, Exception):
90 print >> stderr, '\n%s raised: %s' % (e.__class__.__name__, str(e)) 88 print >> stderr, '\n%s raised: %s' % (e.__class__.__name__, str(e))
91 traceback.print_exc(file=stderr) 89 traceback.print_exc(file=stderr)
92 return EXCEPTIONAL_EXIT_STATUS 90 return EXCEPTIONAL_EXIT_STATUS
93 91
94 92
95 def parse_args(args): 93 def parse_args(args):
96 option_group_definitions = [] 94 option_group_definitions = []
97 95
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 printer.print_config(port.results_directory()) 345 printer.print_config(port.results_directory())
348 346
349 run_details = manager.run(args) 347 run_details = manager.run(args)
350 _log.debug("Testing completed, Exit status: %d" % run_details.exit_code) 348 _log.debug("Testing completed, Exit status: %d" % run_details.exit_code)
351 return run_details 349 return run_details
352 finally: 350 finally:
353 printer.cleanup() 351 printer.cleanup()
354 352
355 if __name__ == '__main__': 353 if __name__ == '__main__':
356 sys.exit(main(sys.argv[1:], sys.stdout, sys.stderr)) 354 sys.exit(main(sys.argv[1:], sys.stdout, sys.stderr))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698