OLD | NEW |
1 # Copyright (c) 2009 Google Inc. All rights reserved. | 1 # Copyright (c) 2009 Google Inc. All rights reserved. |
2 # Copyright (c) 2009 Apple Inc. All rights reserved. | 2 # Copyright (c) 2009 Apple Inc. All rights reserved. |
3 # Copyright (c) 2012 Intel Corporation. All rights reserved. | 3 # Copyright (c) 2012 Intel Corporation. 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 27 matching lines...) Expand all Loading... |
38 from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand | 38 from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand |
39 from webkitpy.layout_tests.models.test_expectations import TestExpectations | 39 from webkitpy.layout_tests.models.test_expectations import TestExpectations |
40 from webkitpy.layout_tests.port import platform_options | 40 from webkitpy.layout_tests.port import platform_options |
41 | 41 |
42 _log = logging.getLogger(__name__) | 42 _log = logging.getLogger(__name__) |
43 | 43 |
44 | 44 |
45 class CrashLog(AbstractDeclarativeCommand): | 45 class CrashLog(AbstractDeclarativeCommand): |
46 name = "crash-log" | 46 name = "crash-log" |
47 help_text = "Print the newest crash log for the given process" | 47 help_text = "Print the newest crash log for the given process" |
| 48 show_in_main_help = True |
48 long_help = """Finds the newest crash log matching the given process name | 49 long_help = """Finds the newest crash log matching the given process name |
49 and PID and prints it to stdout.""" | 50 and PID and prints it to stdout.""" |
50 argument_names = "PROCESS_NAME [PID]" | 51 argument_names = "PROCESS_NAME [PID]" |
51 | 52 |
52 def execute(self, options, args, tool): | 53 def execute(self, options, args, tool): |
53 crash_logs = CrashLogs(tool) | 54 crash_logs = CrashLogs(tool) |
54 pid = None | 55 pid = None |
55 if len(args) > 1: | 56 if len(args) > 1: |
56 pid = int(args[1]) | 57 pid = int(args[1]) |
57 print crash_logs.find_newest_log(args[0], pid) | 58 print crash_logs.find_newest_log(args[0], pid) |
58 | 59 |
59 | 60 |
60 class PrintExpectations(AbstractDeclarativeCommand): | 61 class PrintExpectations(AbstractDeclarativeCommand): |
61 name = 'print-expectations' | 62 name = 'print-expectations' |
62 help_text = 'Print the expected result for the given test(s) on the given po
rt(s)' | 63 help_text = 'Print the expected result for the given test(s) on the given po
rt(s)' |
| 64 show_in_main_help = True |
63 | 65 |
64 def __init__(self): | 66 def __init__(self): |
65 options = [ | 67 options = [ |
66 make_option('--all', action='store_true', default=False, | 68 make_option('--all', action='store_true', default=False, |
67 help='display the expectations for *all* tests'), | 69 help='display the expectations for *all* tests'), |
68 make_option('-x', '--exclude-keyword', action='append', default=[], | 70 make_option('-x', '--exclude-keyword', action='append', default=[], |
69 help='limit to tests not matching the given keyword (for
example, "skip", "slow", or "crash". May specify multiple times'), | 71 help='limit to tests not matching the given keyword (for
example, "skip", "slow", or "crash". May specify multiple times'), |
70 make_option('-i', '--include-keyword', action='append', default=[], | 72 make_option('-i', '--include-keyword', action='append', default=[], |
71 help='limit to tests with the given keyword (for example
, "skip", "slow", or "crash". May specify multiple times'), | 73 help='limit to tests with the given keyword (for example
, "skip", "slow", or "crash". May specify multiple times'), |
72 make_option('--csv', action='store_true', default=False, | 74 make_option('--csv', action='store_true', default=False, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 return output | 146 return output |
145 | 147 |
146 def _model(self, options, port_name, tests): | 148 def _model(self, options, port_name, tests): |
147 port = self._tool.port_factory.get(port_name, options) | 149 port = self._tool.port_factory.get(port_name, options) |
148 return TestExpectations(port, tests).model() | 150 return TestExpectations(port, tests).model() |
149 | 151 |
150 | 152 |
151 class PrintBaselines(AbstractDeclarativeCommand): | 153 class PrintBaselines(AbstractDeclarativeCommand): |
152 name = 'print-baselines' | 154 name = 'print-baselines' |
153 help_text = 'Prints the baseline locations for given test(s) on the given po
rt(s)' | 155 help_text = 'Prints the baseline locations for given test(s) on the given po
rt(s)' |
| 156 show_in_main_help = True |
154 | 157 |
155 def __init__(self): | 158 def __init__(self): |
156 options = [ | 159 options = [ |
157 make_option('--all', action='store_true', default=False, | 160 make_option('--all', action='store_true', default=False, |
158 help='display the baselines for *all* tests'), | 161 help='display the baselines for *all* tests'), |
159 make_option('--csv', action='store_true', default=False, | 162 make_option('--csv', action='store_true', default=False, |
160 help='Print a CSV-style report that includes the port na
me, test_name, test platform, baseline type, baseline location, and baseline pla
tform'), | 163 help='Print a CSV-style report that includes the port na
me, test_name, test platform, baseline type, baseline location, and baseline pla
tform'), |
161 make_option('--include-virtual-tests', action='store_true', | 164 make_option('--include-virtual-tests', action='store_true', |
162 help='Include virtual tests'), | 165 help='Include virtual tests'), |
163 ] + platform_options(use_globs=True) | 166 ] + platform_options(use_globs=True) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 print "%s,%s,%s,%s,%s,%s" % (port_name, test_name, self._pla
tform_for_path(test_name), | 203 print "%s,%s,%s,%s,%s,%s" % (port_name, test_name, self._pla
tform_for_path(test_name), |
201 extension[1:], baseline_locatio
n, self._platform_for_path(baseline_location)) | 204 extension[1:], baseline_locatio
n, self._platform_for_path(baseline_location)) |
202 else: | 205 else: |
203 print baseline_location | 206 print baseline_location |
204 | 207 |
205 def _platform_for_path(self, relpath): | 208 def _platform_for_path(self, relpath): |
206 platform_matchobj = self._platform_regexp.match(relpath) | 209 platform_matchobj = self._platform_regexp.match(relpath) |
207 if platform_matchobj: | 210 if platform_matchobj: |
208 return platform_matchobj.group(1) | 211 return platform_matchobj.group(1) |
209 return None | 212 return None |
OLD | NEW |