| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 import fnmatch | 31 import fnmatch |
| 32 import optparse | 32 import optparse |
| 33 import re | 33 import re |
| 34 | 34 |
| 35 from webkitpy.layout_tests.port import builders | 35 from webkitpy.layout_tests.port import builders |
| 36 | 36 |
| 37 | 37 |
| 38 def platform_options(use_globs=False): | 38 def platform_options(use_globs=False): |
| 39 return [ | 39 return [ |
| 40 optparse.make_option('--platform', action='store', | 40 optparse.make_option('--android', action='store_const', dest='platform', |
| 41 help=('Glob-style list of platform/ports to use (e.g., "mac*")' if u
se_globs else 'Platform to use (e.g., "mac-lion")')), | 41 const=('android*' if use_globs else 'android'), |
| 42 help=('Alias for --platform=android*' if use_globs else 'Alias for -
-platform=android')), |
| 42 | 43 |
| 43 # FIXME: Update run_webkit_tests.sh, any other callers to no longer pass
--chromium, then remove this flag. | 44 # FIXME: Update run_webkit_tests.sh, any other callers to no longer pass
--chromium, then remove this flag. |
| 44 optparse.make_option('--chromium', action='store_const', dest='platform'
, | 45 optparse.make_option('--chromium', action='store_const', dest='platform'
, |
| 45 const=('chromium*' if use_globs else 'chromium'), | 46 const=('chromium*' if use_globs else 'chromium'), |
| 46 help=('Alias for --platform=chromium*' if use_globs else 'Alias for
--platform=chromium')), | 47 help=('Alias for --platform=chromium*' if use_globs else 'Alias for
--platform=chromium')), |
| 47 | 48 |
| 48 optparse.make_option('--android', action='store_const', dest='platform', | 49 optparse.make_option('--platform', action='store', |
| 49 const=('android*' if use_globs else 'android'), | 50 help=('Glob-style list of platform/ports to use (e.g., "mac*")' if u
se_globs else 'Platform to use (e.g., "mac-lion")')), |
| 50 help=('Alias for --platform=android*' if use_globs else 'Alias for -
-platform=android')), | |
| 51 ] | 51 ] |
| 52 | 52 |
| 53 | 53 |
| 54 def configuration_options(): | 54 def configuration_options(): |
| 55 return [ | 55 return [ |
| 56 optparse.make_option('--debug', action='store_const', const='Debug', des
t="configuration", |
| 57 help='Set the configuration to Debug'), |
| 56 optparse.make_option("-t", "--target", dest="configuration", | 58 optparse.make_option("-t", "--target", dest="configuration", |
| 57 help="specify the target configuration to use (Debu
g/Release)"), | 59 help="specify the target configuration to use (Debu
g/Release)"), |
| 58 optparse.make_option('--debug', action='store_const', const='Debug', des
t="configuration", | |
| 59 help='Set the configuration to Debug'), | |
| 60 optparse.make_option('--release', action='store_const', const='Release',
dest="configuration", | 60 optparse.make_option('--release', action='store_const', const='Release',
dest="configuration", |
| 61 help='Set the configuration to Release'), | 61 help='Set the configuration to Release'), |
| 62 ] | 62 ] |
| 63 | 63 |
| 64 | 64 |
| 65 | 65 |
| 66 def _builder_options(builder_name): | 66 def _builder_options(builder_name): |
| 67 configuration = "Debug" if re.search(r"[d|D](ebu|b)g", builder_name) else "R
elease" | 67 configuration = "Debug" if re.search(r"[d|D](ebu|b)g", builder_name) else "R
elease" |
| 68 is_webkit2 = builder_name.find("WK2") != -1 | 68 is_webkit2 = builder_name.find("WK2") != -1 |
| 69 builder_name = builder_name | 69 builder_name = builder_name |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 or "mock-mac", and it does not include any directories that are not. | 130 or "mock-mac", and it does not include any directories that are not. |
| 131 | 131 |
| 132 If platform is not specified, we will glob-match all ports""" | 132 If platform is not specified, we will glob-match all ports""" |
| 133 platform = platform or '*' | 133 platform = platform or '*' |
| 134 return fnmatch.filter(builders.all_port_names(), platform) | 134 return fnmatch.filter(builders.all_port_names(), platform) |
| 135 | 135 |
| 136 def get_from_builder_name(self, builder_name): | 136 def get_from_builder_name(self, builder_name): |
| 137 port_name = builders.port_name_for_builder_name(builder_name) | 137 port_name = builders.port_name_for_builder_name(builder_name) |
| 138 assert port_name, "unrecognized builder name '%s'" % builder_name | 138 assert port_name, "unrecognized builder name '%s'" % builder_name |
| 139 return self.get(port_name, _builder_options(builder_name)) | 139 return self.get(port_name, _builder_options(builder_name)) |
| OLD | NEW |