Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2161)

Unified Diff: dart/tools/testing/architecture.py

Issue 8462004: Integrate leg as a component in test.py. Also update presubmit script to run tests with leg. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/tools/test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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):
+
+ 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)
« no previous file with comments | « dart/tools/test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698