OLD | NEW |
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 #!/usr/bin/python | 5 #!/usr/bin/python |
6 | 6 |
7 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 7 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
8 # Use of this source code is governed by a BSD-style license that can be | 8 # Use of this source code is governed by a BSD-style license that can be |
9 # found in the LICENSE file. | 9 # found in the LICENSE file. |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 pattern = re.match(BUILDER_PATTERN, name) | 56 pattern = re.match(BUILDER_PATTERN, name) |
57 if pattern: | 57 if pattern: |
58 platform = pattern.group(1) | 58 platform = pattern.group(1) |
59 component = pattern.group(2) | 59 component = pattern.group(2) |
60 mode = pattern.group(3) | 60 mode = pattern.group(3) |
61 | 61 |
62 # Fall back if not on builder. | 62 # Fall back if not on builder. |
63 if not name: | 63 if not name: |
64 name = socket.gethostname().split('.')[0] | 64 name = socket.gethostname().split('.')[0] |
65 if not version: | 65 if not version: |
66 has_shell = False | 66 # In Windows we need to run in the shell, so that we have all the |
67 if platform == 'windows': | 67 # environment variables available. |
68 # In Windows we need to run in the shell, so that we have all the | |
69 # environment variables available. | |
70 has_shell = True | |
71 pipe = subprocess.Popen( | 68 pipe = subprocess.Popen( |
72 ['svnversion', '-n'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, | 69 ['svnversion', '-n'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, |
73 shell=has_shell) | 70 shell=True) |
74 output = pipe.communicate() | 71 output = pipe.communicate() |
75 if pipe.returncode == 0: | 72 if pipe.returncode == 0: |
76 version = output[0] | 73 version = output[0] |
77 else: | 74 else: |
78 version = 'unknown' | 75 version = 'unknown' |
79 return (name, version, component, mode, platform) | 76 return (name, version, component, mode, platform) |
80 | 77 |
81 | 78 |
82 def RunDartcCompiler(mode, outdir): | 79 def RunDartcCompiler(mode, outdir): |
83 """Compiles the client code to javascript for dartc tests.""" | 80 """Compiles the client code to javascript for dartc tests.""" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 local_env['PATH'] = (os.path.join(javahome, 'bin') + | 175 local_env['PATH'] = (os.path.join(javahome, 'bin') + |
179 os.pathsep + local_env['PATH']) | 176 os.pathsep + local_env['PATH']) |
180 | 177 |
181 return subprocess.call(cmds, env=local_env) | 178 return subprocess.call(cmds, env=local_env) |
182 | 179 |
183 def ProcessFrog(name): | 180 def ProcessFrog(name): |
184 ''' | 181 ''' |
185 build and test experimental frog build | 182 build and test experimental frog build |
186 ''' | 183 ''' |
187 print 'ProcessFrog' | 184 print 'ProcessFrog' |
188 has_shell = False | |
189 if 'windows' in name: | 185 if 'windows' in name: |
190 os.environ['PATH'] = (os.path.join('C:', 'Program Files (x86)', 'nodejs') + | 186 os.environ['PATH'] = (os.path.join('C:', 'Program Files (x86)', 'nodejs') + |
191 os.pathsep + os.environ['PATH']) | 187 os.pathsep + os.environ['PATH']) |
192 # In Windows we need to run in the shell, so that we have all the | 188 # In Windows we need to run in the shell, so that we have all the |
193 # environment variables available. | 189 # environment variables available. |
194 has_shell = True | |
195 | |
196 return subprocess.call([sys.executable + ' ' + | 190 return subprocess.call([sys.executable + ' ' + |
197 os.path.join('frog', 'scripts', 'buildbot_annotated_steps.py')], | 191 os.path.join('frog', 'scripts', 'buildbot_annotated_steps.py')], |
198 env=os.environ, shell=has_shell) | 192 env=os.environ, shell=True) |
199 | 193 |
200 def main(): | 194 def main(): |
201 print 'main' | 195 print 'main' |
202 if len(sys.argv) == 0: | 196 if len(sys.argv) == 0: |
203 print 'Script pathname not known, giving up.' | 197 print 'Script pathname not known, giving up.' |
204 return 1 | 198 return 1 |
205 | 199 |
206 scriptdir = os.path.dirname(sys.argv[0]) | 200 scriptdir = os.path.dirname(sys.argv[0]) |
207 # Get at the top-level directory. This script is in client/tools | 201 # Get at the top-level directory. This script is in client/tools |
208 os.chdir(os.path.abspath(os.path.join(scriptdir, os.pardir, os.pardir))) | 202 os.chdir(os.path.abspath(os.path.join(scriptdir, os.pardir, os.pardir))) |
209 | 203 |
210 (name, version, component, mode, platform) = GetBuildInfo() | 204 (name, version, component, mode, platform) = GetBuildInfo() |
211 if name.startswith('dart-editor'): | 205 if name.startswith('dart-editor'): |
212 status = ProcessTools(mode, name, version) | 206 status = ProcessTools(mode, name, version) |
213 #TODO(sigmund): remove this indirection once we update our bots | 207 #TODO(sigmund): remove this indirection once we update our bots |
214 elif name.startswith('frog'): | 208 elif name.startswith('frog'): |
215 status = ProcessFrog(name) | 209 status = ProcessFrog(name) |
216 else: | 210 else: |
217 status = ProcessDartClientTests(component, mode, platform, name) | 211 status = ProcessDartClientTests(component, mode, platform, name) |
218 | 212 |
219 if status: | 213 if status: |
220 print '@@@STEP_FAILURE@@@' | 214 print '@@@STEP_FAILURE@@@' |
221 | 215 |
222 return status | 216 return status |
223 | 217 |
224 | 218 |
225 if __name__ == '__main__': | 219 if __name__ == '__main__': |
226 sys.exit(main()) | 220 sys.exit(main()) |
OLD | NEW |