Chromium Code Reviews| Index: dart/tools/testing/architecture.py |
| =================================================================== |
| --- dart/tools/testing/architecture.py (revision 1186) |
| +++ dart/tools/testing/architecture.py (working copy) |
| @@ -410,25 +410,20 @@ |
| fatal_static_type_errors = fatal_static_type_errors # shutup lint! |
| return None |
| + def GetOptions(self): |
| + return [] |
| + |
| def GetRunCommand(self, fatal_static_type_errors=False): |
| """Returns a command line to execute for the test.""" |
| dart = self.GetExecutable() |
| - test_name = os.path.basename(self.test) |
| - test_path = os.path.abspath(self.test) |
| - command = [dart] + self.vm_options |
| - if self.mode == 'release': |
| - command += ['--optimize'] |
| - (classname, extension) = os.path.splitext(test_name) |
| + command = [dart] + self.GetOptions() + self.vm_options |
| + if fatal_static_type_errors: |
| + command += self.GetFatalTypeErrorsFlags() |
| + |
| if self.dart_options: |
| command += self.dart_options |
| - elif extension == '.dart': |
| - if fatal_static_type_errors: |
| - command += self.GetFatalTypeErrorsFlags() |
| - if '_' in classname: |
| - (classname, unused_sep, unused_tag) = classname.rpartition('_') |
| - command += [test_path] |
| else: |
| - command += ['--', test_path] |
| + command += [self.test] |
| return command |
| @@ -443,6 +438,19 @@ |
| return |
| +class LegArchitecture(StandaloneArchitecture): |
|
kasperl
2011/11/04 10:13:00
Should we have a leg and a legsh?
ngeoffray
2011/11/04 10:16:44
Let's do that in a future cl.
|
| + |
| + def __init__(self, root_path, arch, mode, component, test): |
| + super(LegArchitecture, self).__init__(root_path, arch, mode, component, |
| + test) |
| + def GetOptions(self): |
| + return ['--enable_leg'] |
| + |
| + def GetExecutable(self): |
| + """Returns the path to the Dart test runner (executes the .dart file).""" |
| + return utils.GetDartRunner(self.mode, self.arch, 'frog') |
| + |
| + |
| # Long term, we should do the running machinery that is currently in |
| # DartRunner.java |
| class DartcArchitecture(StandaloneArchitecture): |
| @@ -451,19 +459,17 @@ |
| def __init__(self, root_path, arch, mode, component, test): |
| super(DartcArchitecture, self).__init__(root_path, arch, mode, component, test) |
| + def GetOptions(self): |
| + if self.mode == 'release': return ['--optimize'] |
| + return [] |
| + |
| def GetFatalTypeErrorsFlags(self): |
| return ['--fatal-type-errors'] |
| def HasFatalTypeErrors(self): |
| return True |
| - def GetRunCommand(self, fatal_static_type_errors=False): |
| - """Returns a command line to execute for the test.""" |
| - cmd = super(DartcArchitecture, self).GetRunCommand( |
| - fatal_static_type_errors) |
| - return cmd |
| - |
| def ExecutePipedCommand(cmd, verbose): |
| """Execute a command in a subprocess.""" |
| if verbose: |
| @@ -494,5 +500,8 @@ |
| elif component in ['vm', 'frog', 'frogsh']: |
| return StandaloneArchitecture(root_path, arch, mode, component, test) |
| + elif component == 'leg': |
| + return LegArchitecture(root_path, arch, mode, component, test) |
| + |
| elif component == 'dartc': |
| return DartcArchitecture(root_path, arch, mode, component, test) |