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

Side by Side Diff: test/cctest/testcfg.py

Issue 3164023: Refactor the tools/test.py script and related testcfg.py files.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 3 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
« no previous file with comments | « no previous file | test/es5conform/testcfg.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2008 the V8 project authors. All rights reserved. 1 # Copyright 2008 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 13 matching lines...) Expand all
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 import test 28 import test
29 import os 29 import os
30 from os.path import join, dirname, exists 30 from os.path import join, dirname, exists
31 import platform 31 import platform
32 import utils 32 import utils
33 33
34 CCTEST_DEBUG_FLAGS = ['--enable-slow-asserts', '--debug-code', '--verify-heap']
35
36 34
37 class CcTestCase(test.TestCase): 35 class CcTestCase(test.TestCase):
38 36
39 def __init__(self, path, executable, mode, raw_name, dependency, context): 37 def __init__(self, path, executable, mode, raw_name, dependency, context):
40 super(CcTestCase, self).__init__(context, path) 38 super(CcTestCase, self).__init__(context, path, mode)
41 self.executable = executable 39 self.executable = executable
42 self.mode = mode
43 self.raw_name = raw_name 40 self.raw_name = raw_name
44 self.dependency = dependency 41 self.dependency = dependency
45 42
46 def GetLabel(self): 43 def GetLabel(self):
47 return "%s %s %s" % (self.mode, self.path[-2], self.path[-1]) 44 return "%s %s %s" % (self.mode, self.path[-2], self.path[-1])
48 45
49 def GetName(self): 46 def GetName(self):
50 return self.path[-1] 47 return self.path[-1]
51 48
52 def BuildCommand(self, name): 49 def BuildCommand(self, name):
53 serialization_file = join('obj', 'test', self.mode, 'serdes') 50 serialization_file = join('obj', 'test', self.mode, 'serdes')
54 serialization_file += '_' + self.GetName() 51 serialization_file += '_' + self.GetName()
55 serialization_option = '--testing_serialization_file=' + serialization_file 52 serialization_option = '--testing_serialization_file=' + serialization_file
56 result = [ self.executable, name, serialization_option ] 53 result = [ self.executable, name, serialization_option ]
57 if self.mode == 'debug': 54 result += self.context.GetVmFlags(self, self.mode)
58 result += CCTEST_DEBUG_FLAGS
59 return result 55 return result
60 56
61 def GetCommand(self): 57 def GetCommand(self):
62 return self.BuildCommand(self.raw_name) 58 return self.BuildCommand(self.raw_name)
63 59
64 def Run(self): 60 def Run(self):
65 if self.dependency != '': 61 if self.dependency != '':
66 dependent_command = self.BuildCommand(self.dependency) 62 dependent_command = self.BuildCommand(self.dependency)
67 output = self.RunCommand(dependent_command) 63 output = self.RunCommand(dependent_command)
68 if output.HasFailed(): 64 if output.HasFailed():
(...skipping 30 matching lines...) Expand all
99 return result 95 return result
100 96
101 def GetTestStatus(self, sections, defs): 97 def GetTestStatus(self, sections, defs):
102 status_file = join(self.root, 'cctest.status') 98 status_file = join(self.root, 'cctest.status')
103 if exists(status_file): 99 if exists(status_file):
104 test.ReadConfigurationInto(status_file, sections, defs) 100 test.ReadConfigurationInto(status_file, sections, defs)
105 101
106 102
107 def GetConfiguration(context, root): 103 def GetConfiguration(context, root):
108 return CcTestConfiguration(context, root) 104 return CcTestConfiguration(context, root)
OLDNEW
« no previous file with comments | « no previous file | test/es5conform/testcfg.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698