| OLD | NEW | 
|    1 #!/usr/bin/env python |    1 #!/usr/bin/env python | 
|    2 # |    2 # | 
|    3 # Copyright 2011 Google Inc. All Rights Reserved. |    3 # Copyright 2011 Google Inc. All Rights Reserved. | 
|    4  |    4  | 
|    5 import fnmatch |    5 import fnmatch | 
|    6 import optparse |    6 import optparse | 
|    7 import os |    7 import os | 
|    8 import re |    8 import re | 
|    9 import shutil |    9 import shutil | 
|   10 import subprocess |   10 import subprocess | 
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  105                     default=False, dest='buildbot', |  105                     default=False, dest='buildbot', | 
|  106                     help='Print results in buildbot format') |  106                     help='Print results in buildbot format') | 
|  107   parser.add_option('--layout-test', dest='layout_test', |  107   parser.add_option('--layout-test', dest='layout_test', | 
|  108                     default=None, |  108                     default=None, | 
|  109                     action='store', type='string', |  109                     action='store', type='string', | 
|  110                     help='Single layout test to run if set') |  110                     help='Single layout test to run if set') | 
|  111   parser.add_option('--test-filter', dest='test_filter', |  111   parser.add_option('--test-filter', dest='test_filter', | 
|  112                     default=None, |  112                     default=None, | 
|  113                     action='store', type='string', |  113                     action='store', type='string', | 
|  114                     help='Test filter for core tests') |  114                     help='Test filter for core tests') | 
|  115   parser.add_option('--win-ninja-build', action='store_true', |  | 
|  116                     default=False, dest='is_win_ninja', |  | 
|  117                     help='We are on windows and use ninja for building.') |  | 
|  118  |  115  | 
|  119   (options, args) = parser.parse_args() |  116   (options, args) = parser.parse_args() | 
|  120   mode = options.mode |  117   mode = options.mode | 
|  121   if not (mode in ['Debug', 'Release']): |  118   if not (mode in ['Debug', 'Release']): | 
|  122     raise Exception('Invalid test mode') |  119     raise Exception('Invalid test mode') | 
|  123  |  120  | 
|  124   if options.component == 'all': |  121   if options.component == 'all': | 
|  125     components = COMPONENTS |  122     components = COMPONENTS | 
|  126   elif not (options.component in COMPONENTS): |  123   elif not (options.component in COMPONENTS): | 
|  127     raise Exception('Invalid component %s' % options.component) |  124     raise Exception('Invalid component %s' % options.component) | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
|  151   timeout = 30000 |  148   timeout = 30000 | 
|  152   if mode == 'Debug': |  149   if mode == 'Debug': | 
|  153     test_mode = '--debug' |  150     test_mode = '--debug' | 
|  154     timeout = 60000 |  151     timeout = 60000 | 
|  155  |  152  | 
|  156   show_results = '' |  153   show_results = '' | 
|  157   if not options.show_results: |  154   if not options.show_results: | 
|  158     show_results = '--no-show-results' |  155     show_results = '--no-show-results' | 
|  159  |  156  | 
|  160   host_os = utils.guessOS() |  157   host_os = utils.guessOS() | 
|  161   if options.is_win_ninja: |  | 
|  162     host_os = 'win-ninja' |  | 
|  163   build_root, drt_path, dartium_path, dart_path  = { |  158   build_root, drt_path, dartium_path, dart_path  = { | 
|  164       'mac': ( |  159       'mac': ( | 
|  165         'out', |  160         'out', | 
|  166         os.path.join('Content Shell.app', 'Contents', 'MacOS', 'Content Shell'), |  161         os.path.join('Content Shell.app', 'Contents', 'MacOS', 'Content Shell'), | 
|  167         os.path.join('Chromium.app', 'Contents', 'MacOS', 'Chromium'), |  162         os.path.join('Chromium.app', 'Contents', 'MacOS', 'Chromium'), | 
|  168         'dart', |  163         'dart', | 
|  169       ), |  164       ), | 
|  170       'linux': ('out', 'content_shell', 'chrome', 'dart'), |  165       'linux': ('out', 'content_shell', 'chrome', 'dart'), | 
|  171       'win': ('out', 'content_shell.exe', 'chrome.exe', 'dart.exe'), |  166       'win': ('out', 'content_shell.exe', 'chrome.exe', 'dart.exe'), | 
|  172       'win-ninja': ('out', 'content_shell.exe', 'chrome.exe', 'dart.exe'), |  | 
|  173   }[host_os] |  167   }[host_os] | 
|  174  |  168  | 
|  175   build_dir = os.path.join(srcpath, build_root, mode) |  169   build_dir = os.path.join(srcpath, build_root, mode) | 
|  176  |  170  | 
|  177   executable_map = { |  171   executable_map = { | 
|  178     'mode': mode.lower(), |  172     'mode': mode.lower(), | 
|  179     'build_dir': os.path.relpath(build_dir), |  173     'build_dir': os.path.relpath(build_dir), | 
|  180     'drt': os.path.join(build_dir, drt_path), |  174     'drt': os.path.join(build_dir, drt_path), | 
|  181     'dartium': os.path.join(build_dir, dartium_path), |  175     'dartium': os.path.join(build_dir, dartium_path), | 
|  182     'dart': os.path.join(build_dir, dart_path), |  176     'dart': os.path.join(build_dir, dart_path), | 
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  233     return 1 |  227     return 1 | 
|  234   else: |  228   else: | 
|  235     return 0 |  229     return 0 | 
|  236  |  230  | 
|  237 if __name__ == '__main__': |  231 if __name__ == '__main__': | 
|  238   try: |  232   try: | 
|  239     sys.exit(main()) |  233     sys.exit(main()) | 
|  240   except StandardError as e: |  234   except StandardError as e: | 
|  241     print 'Fail: ' + str(e) |  235     print 'Fail: ' + str(e) | 
|  242     sys.exit(1) |  236     sys.exit(1) | 
| OLD | NEW |