Chromium Code Reviews| Index: dart/tools/testing/architecture.py |
| =================================================================== |
| --- dart/tools/testing/architecture.py (revision 952) |
| +++ dart/tools/testing/architecture.py (working copy) |
| @@ -3,16 +3,6 @@ |
| # BSD-style license that can be found in the LICENSE file. |
| # |
| -"""Runs a Dart unit test in different configurations. |
| - |
| -Currently supported architectures include dartium, chromium, ia32, x64, |
| -arm, simarm, and dartc. |
| - |
| -Example: |
| - run.py --arch=dartium --mode=release --test=Test.dart |
| - |
| -""" |
| - |
| import os |
| import platform |
| import re |
| @@ -144,12 +134,13 @@ |
| class Architecture(object): |
|
Siggi Cherem (dart-lang)
2011/10/31 17:18:48
(probably for a follow up cl) Architecture --> Tes
ngeoffray
2011/11/01 08:30:50
Yes, naming them Architecture is really confusing
|
| - """Definitions for different ways to test based on the --arch flag.""" |
| + """Definitions for different ways to test based on the FOOBAR flag.""" |
| - def __init__(self, root_path, arch, mode, test): |
| + def __init__(self, root_path, arch, mode, FOOBAR, test): |
| self.root_path = root_path |
| self.arch = arch |
| self.mode = mode |
| + self.FOOBAR = FOOBAR |
| self.test = test |
| self.build_root = utils.GetBuildRoot(OS_GUESS, self.mode, self.arch) |
| source = file(test).read() |
| @@ -161,7 +152,7 @@ |
| self.temp_dir = None |
| def HasFatalTypeErrors(self): |
| - """Returns True if this type of arch supports --fatal-type-errors.""" |
| + """Returns True if this type of FOOBAR supports --fatal-type-errors.""" |
| return False |
| def GetTestFrameworkPath(self): |
| @@ -173,8 +164,9 @@ |
| class BrowserArchitecture(Architecture): |
| """Architecture that runs compiled dart->JS through a browser.""" |
| - def __init__(self, root_path, arch, mode, test): |
| - super(BrowserArchitecture, self).__init__(root_path, arch, mode, test) |
| + def __init__(self, root_path, arch, mode, FOOBAR, test): |
| + super(BrowserArchitecture, self).__init__(root_path, arch, mode, FOOBAR, |
| + test) |
| self.temp_dir = tempfile.mkdtemp() |
| if not self.is_web_test: self.GenerateWebTestScript() |
| @@ -219,7 +211,7 @@ |
| unittest_path = os.path.join(self.root_path, 'client', 'testing', |
| 'unittest', 'unittest.dart') |
| - if self.arch == 'chromium': |
| + if self.FOOBAR == 'chromium': |
| dom_path = os.path.join(self.root_path, 'client', 'testing', |
| 'unittest', 'dom_for_unittest.dart') |
| else: |
| @@ -324,8 +316,8 @@ |
| class ChromiumArchitecture(BrowserArchitecture): |
| """Architecture that runs compiled dart->JS through a chromium DRT.""" |
| - def __init__(self, root_path, arch, mode, test): |
| - super(ChromiumArchitecture, self).__init__(root_path, arch, mode, test) |
| + def __init__(self, root_path, arch, mode, FOOBAR, test): |
| + super(ChromiumArchitecture, self).__init__(root_path, arch, mode, FOOBAR, test) |
| def GetScriptType(self): |
| return 'text/javascript' |
| @@ -368,8 +360,8 @@ |
| class DartiumArchitecture(BrowserArchitecture): |
| """Architecture that runs dart in an VM embedded in DumpRenderTree.""" |
| - def __init__(self, root_path, arch, mode, test): |
| - super(DartiumArchitecture, self).__init__(root_path, arch, mode, test) |
| + def __init__(self, root_path, arch, mode, FOOBAR, test): |
| + super(DartiumArchitecture, self).__init__(root_path, arch, mode, FOOBAR, test) |
| def GetScriptType(self): |
| return 'application/dart' |
| @@ -392,8 +384,9 @@ |
| class StandaloneArchitecture(Architecture): |
| """Base class for architectures that run tests without a browser.""" |
| - def __init__(self, root_path, arch, mode, test): |
| - super(StandaloneArchitecture, self).__init__(root_path, arch, mode, test) |
| + def __init__(self, root_path, arch, mode, FOOBAR, test): |
| + super(StandaloneArchitecture, self).__init__(root_path, arch, mode, FOOBAR, |
| + test) |
| def GetCompileCommand(self, fatal_static_type_errors=False): |
| fatal_static_type_errors = fatal_static_type_errors # shutup lint! |
| @@ -437,8 +430,8 @@ |
| class DartcArchitecture(StandaloneArchitecture): |
| """Runs the Dart ->JS compiler then runs the result in a standalone JS VM.""" |
| - def __init__(self, root_path, arch, mode, test): |
| - super(DartcArchitecture, self).__init__(root_path, arch, mode, test) |
| + def __init__(self, root_path, arch, mode, FOOBAR, test): |
| + super(DartcArchitecture, self).__init__(root_path, arch, mode, FOOBAR, test) |
| def GetExecutable(self): |
| """Returns the name of the executable to run the test.""" |
| @@ -463,8 +456,9 @@ |
| class RuntimeArchitecture(StandaloneArchitecture): |
| """Executes tests on the standalone VM (runtime).""" |
| - def __init__(self, root_path, arch, mode, test): |
| - super(RuntimeArchitecture, self).__init__(root_path, arch, mode, test) |
| + def __init__(self, root_path, arch, mode, FOOBAR, test): |
| + super(RuntimeArchitecture, self).__init__(root_path, arch, mode, FOOBAR, |
| + test) |
| def GetExecutable(self): |
| """Returns the name of the executable to run the test.""" |
| @@ -490,16 +484,16 @@ |
| return subprocess.call(cmd) |
| -def GetArchitecture(arch, mode, test): |
| +def GetArchitecture(arch, mode, FOOBAR, test): |
| root_path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..')) |
| - if arch == 'chromium': |
| - return ChromiumArchitecture(root_path, arch, mode, test) |
| + if FOOBAR == 'chromium': |
| + return ChromiumArchitecture(root_path, arch, mode, FOOBAR, test) |
| - elif arch == 'dartium': |
| - return DartiumArchitecture(root_path, arch, mode, test) |
| + elif FOOBAR == 'dartium': |
| + return DartiumArchitecture(root_path, arch, mode, FOOBAR, test) |
| - elif arch in ['ia32', 'x64', 'simarm', 'arm']: |
| - return RuntimeArchitecture(root_path, arch, mode, test) |
| + elif FOOBAR == 'vm': |
| + return RuntimeArchitecture(root_path, arch, mode, FOOBAR, test) |
| - elif arch == 'dartc': |
| - return DartcArchitecture(root_path, arch, mode, test) |
| + elif FOOBAR == 'dartc': |
| + return DartcArchitecture(root_path, arch, mode, FOOBAR, test) |