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

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

Issue 6670045: Use full paths for cctests. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 9 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 | « test/benchmarks/testcfg.py ('k') | no next file » | 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 def GetLabel(self): 43 def GetLabel(self):
44 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])
45 45
46 def GetName(self): 46 def GetName(self):
47 return self.path[-1] 47 return self.path[-1]
48 48
49 def BuildCommand(self, name): 49 def BuildCommand(self, name):
50 serialization_file = join('obj', 'test', self.mode, 'serdes') 50 serialization_file = join('obj', 'test', self.mode, 'serdes')
51 serialization_file += '_' + self.GetName() 51 serialization_file += '_' + self.GetName()
52 serialization_file = join(self.context.buildspace, serialization_file)
52 serialization_option = '--testing_serialization_file=' + serialization_file 53 serialization_option = '--testing_serialization_file=' + serialization_file
53 result = [ self.executable, name, serialization_option ] 54 result = [ self.executable, name, serialization_option ]
54 result += self.context.GetVmFlags(self, self.mode) 55 result += self.context.GetVmFlags(self, self.mode)
55 return result 56 return result
56 57
57 def GetCommand(self): 58 def GetCommand(self):
58 return self.BuildCommand(self.raw_name) 59 return self.BuildCommand(self.raw_name)
59 60
60 def Run(self): 61 def Run(self):
61 if self.dependency != '': 62 if self.dependency != '':
62 dependent_command = self.BuildCommand(self.dependency) 63 dependent_command = self.BuildCommand(self.dependency)
63 output = self.RunCommand(dependent_command) 64 output = self.RunCommand(dependent_command)
64 if output.HasFailed(): 65 if output.HasFailed():
65 return output 66 return output
66 return test.TestCase.Run(self) 67 return test.TestCase.Run(self)
67 68
68 69
69 class CcTestConfiguration(test.TestConfiguration): 70 class CcTestConfiguration(test.TestConfiguration):
70 71
71 def __init__(self, context, root): 72 def __init__(self, context, root):
72 super(CcTestConfiguration, self).__init__(context, root) 73 super(CcTestConfiguration, self).__init__(context, root)
73 74
74 def GetBuildRequirements(self): 75 def GetBuildRequirements(self):
75 return ['cctests'] 76 return ['cctests']
76 77
77 def ListTests(self, current_path, path, mode): 78 def ListTests(self, current_path, path, mode):
78 executable = join('obj', 'test', mode, 'cctest') 79 executable = join('obj', 'test', mode, 'cctest')
79 if utils.IsWindows(): 80 if utils.IsWindows():
80 executable += '.exe' 81 executable += '.exe'
82 executable = join(self.context.buildspace, executable)
81 output = test.Execute([executable, '--list'], self.context) 83 output = test.Execute([executable, '--list'], self.context)
82 if output.exit_code != 0: 84 if output.exit_code != 0:
83 print output.stdout 85 print output.stdout
84 print output.stderr 86 print output.stderr
85 return [] 87 return []
86 result = [] 88 result = []
87 for test_desc in output.stdout.strip().split(): 89 for test_desc in output.stdout.strip().split():
88 raw_test, dependency = test_desc.split('<') 90 raw_test, dependency = test_desc.split('<')
89 relative_path = raw_test.split('/') 91 relative_path = raw_test.split('/')
90 full_path = current_path + relative_path 92 full_path = current_path + relative_path
91 if dependency != '': 93 if dependency != '':
92 dependency = relative_path[0] + '/' + dependency 94 dependency = relative_path[0] + '/' + dependency
93 if self.Contains(path, full_path): 95 if self.Contains(path, full_path):
94 result.append(CcTestCase(full_path, executable, mode, raw_test, dependen cy, self.context)) 96 result.append(CcTestCase(full_path, executable, mode, raw_test, dependen cy, self.context))
95 result.sort() 97 result.sort()
96 return result 98 return result
97 99
98 def GetTestStatus(self, sections, defs): 100 def GetTestStatus(self, sections, defs):
99 status_file = join(self.root, 'cctest.status') 101 status_file = join(self.root, 'cctest.status')
100 if exists(status_file): 102 if exists(status_file):
101 test.ReadConfigurationInto(status_file, sections, defs) 103 test.ReadConfigurationInto(status_file, sections, defs)
102 104
103 105
104 def GetConfiguration(context, root): 106 def GetConfiguration(context, root):
105 return CcTestConfiguration(context, root) 107 return CcTestConfiguration(context, root)
OLDNEW
« no previous file with comments | « test/benchmarks/testcfg.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698