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

Side by Side Diff: tools/testing/test_case.py

Issue 8226016: Add the ability to run tests with several sets of VM flags (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed code in comments Created 9 years, 2 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 import atexit 5 import atexit
6 import fileinput 6 import fileinput
7 import os 7 import os
8 import test 8 import test
9 import platform 9 import platform
10 import re 10 import re
11 import sys 11 import sys
12 import tempfile 12 import tempfile
13 13
14 import architecture 14 import architecture
15 import test 15 import test
16 import utils 16 import utils
17 17
18 from os.path import join, exists, basename 18 from os.path import join, exists, basename
19 19
20 import utils 20 import utils
21 21
22 class Error(Exception): 22 class Error(Exception):
23 pass 23 pass
24 24
25 25
26 class StandardTestCase(test.TestCase): 26 class StandardTestCase(test.TestCase):
27 def __init__(self, context, path, filename, mode, arch): 27 def __init__(self, context, path, filename, mode, arch, vm_options = None):
28 super(StandardTestCase, self).__init__(context, path) 28 super(StandardTestCase, self).__init__(context, path)
29 self.filename = filename 29 self.filename = filename
30 self.mode = mode 30 self.mode = mode
31 self.arch = arch 31 self.arch = arch
32 self.run_arch = architecture.GetArchitecture(self.arch, self.mode, 32 self.run_arch = architecture.GetArchitecture(self.arch, self.mode,
33 self.filename) 33 self.filename)
34 for flag in context.flags: 34 for flag in context.flags:
35 self.run_arch.vm_options.append(flag) 35 self.run_arch.vm_options.append(flag)
36 36
37 if vm_options:
38 for vm_option in vm_options:
39 if (len(vm_option) > 0):
40 self.run_arch.vm_options.append(vm_option)
41
37 def IsNegative(self): 42 def IsNegative(self):
38 return self.GetName().endswith("NegativeTest") 43 return self.GetName().endswith("NegativeTest")
39 44
40 def GetLabel(self): 45 def GetLabel(self):
41 return "%s%s %s" % (self.mode, self.arch, '/'.join(self.path)) 46 return "%s%s %s" % (self.mode, self.arch, '/'.join(self.path))
42 47
43 def GetCommand(self): 48 def GetCommand(self):
44 return self.run_arch.GetRunCommand(); 49 return self.run_arch.GetRunCommand();
45 50
46 def GetName(self): 51 def GetName(self):
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 cmd += ['-check-only', 138 cmd += ['-check-only',
134 '-fatal-type-errors', 139 '-fatal-type-errors',
135 '-Werror', 140 '-Werror',
136 '-out', self.temp_dir, 141 '-out', self.temp_dir,
137 self.filename] 142 self.filename]
138 143
139 return cmd 144 return cmd
140 145
141 def GetName(self): 146 def GetName(self):
142 return self.path[-1] 147 return self.path[-1]
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698