OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Installs deps for using SDK emulator for testing. | 6 """Installs deps for using SDK emulator for testing. |
7 | 7 |
8 The script will download the SDK and system images, if they are not present, and | 8 The script will download the SDK and system images, if they are not present, and |
9 install and enable KVM, if virtualization has been enabled in the BIOS. | 9 install and enable KVM, if virtualization has been enabled in the BIOS. |
10 """ | 10 """ |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 224 |
225 | 225 |
226 def main(argv): | 226 def main(argv): |
227 opt_parser = optparse.OptionParser( | 227 opt_parser = optparse.OptionParser( |
228 description='Install dependencies for running the Android emulator') | 228 description='Install dependencies for running the Android emulator') |
229 opt_parser.add_option('--api-level', dest='api_level', | 229 opt_parser.add_option('--api-level', dest='api_level', |
230 help='The API level (e.g., 19 for Android 4.4) to ensure is available', | 230 help='The API level (e.g., 19 for Android 4.4) to ensure is available', |
231 type='int', default=DEFAULT_ANDROID_API_LEVEL) | 231 type='int', default=DEFAULT_ANDROID_API_LEVEL) |
232 opt_parser.add_option('-v', dest='verbose', action='store_true', | 232 opt_parser.add_option('-v', dest='verbose', action='store_true', |
233 help='enable verbose logging') | 233 help='enable verbose logging') |
234 options, _ = opt_parser.parse_args(argv[1:]) | 234 options, _args = opt_parser.parse_args(argv[1:]) |
235 | 235 |
236 # run_tests_helper will set logging to INFO or DEBUG | 236 # run_tests_helper will set logging to INFO or DEBUG |
237 # We achieve verbose output by configuring it with 2 (==DEBUG) | 237 # We achieve verbose output by configuring it with 2 (==DEBUG) |
238 verbosity = 1 | 238 verbosity = 1 |
239 if (options.verbose): | 239 if (options.verbose): |
240 verbosity = 2 | 240 verbosity = 2 |
241 logging.basicConfig(level=logging.INFO, | 241 logging.basicConfig(level=logging.INFO, |
242 format='# %(asctime)-15s: %(message)s') | 242 format='# %(asctime)-15s: %(message)s') |
243 run_tests_helper.SetLogLevel(verbose_count=verbosity) | 243 run_tests_helper.SetLogLevel(verbose_count=verbosity) |
244 | 244 |
(...skipping 21 matching lines...) Expand all Loading... |
266 | 266 |
267 # Make sure KVM packages are installed and enabled. | 267 # Make sure KVM packages are installed and enabled. |
268 if CheckKVM(): | 268 if CheckKVM(): |
269 logging.info('KVM already installed and enabled.') | 269 logging.info('KVM already installed and enabled.') |
270 else: | 270 else: |
271 InstallKVM() | 271 InstallKVM() |
272 | 272 |
273 | 273 |
274 if __name__ == '__main__': | 274 if __name__ == '__main__': |
275 sys.exit(main(sys.argv)) | 275 sys.exit(main(sys.argv)) |
OLD | NEW |