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

Side by Side Diff: test/benchmarks/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 | « no previous file | test/cctest/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 2011 the V8 project authors. All rights reserved. 1 # Copyright 2011 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 23 matching lines...) Expand all
34 try: 34 try:
35 float(string) 35 float(string)
36 return True 36 return True
37 except ValueError: 37 except ValueError:
38 return False 38 return False
39 39
40 40
41 class BenchmarkTestCase(test.TestCase): 41 class BenchmarkTestCase(test.TestCase):
42 42
43 def __init__(self, path, context, mode): 43 def __init__(self, path, context, mode):
44 super(BenchmarkTestCase, self).__init__(context, path, mode) 44 super(BenchmarkTestCase, self).__init__(context, split(path), mode)
45 self.root = '/'.join(self.path) 45 self.root = path
46 46
47 def GetLabel(self): 47 def GetLabel(self):
48 return '%s benchmark %s' % (self.mode, self.GetName()) 48 return '%s benchmark %s' % (self.mode, self.GetName())
49 49
50 def IsFailureOutput(self, output): 50 def IsFailureOutput(self, output):
51 if output.exit_code != 0: 51 if output.exit_code != 0:
52 return True 52 return True
53 lines = output.stdout.splitlines() 53 lines = output.stdout.splitlines()
54 for line in lines: 54 for line in lines:
55 colon_index = line.find(':') 55 colon_index = line.find(':')
56 if colon_index >= 0: 56 if colon_index >= 0:
57 if not IsNumber(line[colon_index+1:].strip()): 57 if not IsNumber(line[colon_index+1:].strip()):
58 return True 58 return True
59 return False 59 return False
60 60
61 def GetCommand(self): 61 def GetCommand(self):
62 result = self.context.GetVmCommand(self, self.mode) 62 result = self.context.GetVmCommand(self, self.mode)
63 result.append(join(self.root, 'run.js')) 63 result.append(join(self.root, 'run.js'))
64 return result 64 return result
65 65
66 def GetName(self): 66 def GetName(self):
67 return 'V8' 67 return 'V8'
68 68
69 def BeforeRun(self): 69 def BeforeRun(self):
70 self.dir_before = os.getcwd()
71 os.chdir(self.root) 70 os.chdir(self.root)
72 71
73 def AfterRun(self, result): 72 def AfterRun(self, result):
74 os.chdir(self.dir_before) 73 os.chdir(self.context.buildspace)
75 74
76 def GetSource(self): 75 def GetSource(self):
77 return open(join(self.root, 'run.js')).read() 76 return open(join(self.root, 'run.js')).read()
78 77
79 def GetCustomFlags(self, mode): 78 def GetCustomFlags(self, mode):
80 return [] 79 return []
81 80
82 81
83 class BenchmarkTestConfiguration(test.TestConfiguration): 82 class BenchmarkTestConfiguration(test.TestConfiguration):
84 83
85 def __init__(self, context, root): 84 def __init__(self, context, root):
86 super(BenchmarkTestConfiguration, self).__init__(context, root) 85 super(BenchmarkTestConfiguration, self).__init__(context, root)
87 86
88 def ListTests(self, current_path, path, mode): 87 def ListTests(self, current_path, path, mode):
89 path = self.root.split(os.path.sep)[:-2] 88 path = self.context.workspace
90 path.append('benchmarks') 89 path = join(path, 'benchmarks')
91 test = BenchmarkTestCase(path, self.context, mode) 90 test = BenchmarkTestCase(path, self.context, mode)
92 return [test] 91 return [test]
93 92
94 def GetBuildRequirements(self): 93 def GetBuildRequirements(self):
95 return ['sample', 'sample=shell'] 94 return ['sample', 'sample=shell']
96 95
97 def GetTestStatus(self, sections, defs): 96 def GetTestStatus(self, sections, defs):
98 pass 97 pass
99 98
100 def GetConfiguration(context, root): 99 def GetConfiguration(context, root):
101 return BenchmarkTestConfiguration(context, root) 100 return BenchmarkTestConfiguration(context, root)
OLDNEW
« no previous file with comments | « no previous file | test/cctest/testcfg.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698