OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # Enable 'with' statements in Python 2.5 | 6 # Enable 'with' statements in Python 2.5 |
7 from __future__ import with_statement | 7 from __future__ import with_statement |
8 | 8 |
9 import os.path | 9 import os.path |
10 import re | 10 import re |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 cmd=[gn_path, '--dotfile=../native_client/.gn', | 185 cmd=[gn_path, '--dotfile=../native_client/.gn', |
186 '--root=..', 'gen', '../out']) | 186 '--root=..', 'gen', '../out']) |
187 Command(context, cmd=['ninja', '-C', '../out', '-j10'] + targets) | 187 Command(context, cmd=['ninja', '-C', '../out', '-j10'] + targets) |
188 | 188 |
189 if context['clang']: | 189 if context['clang']: |
190 with Step('update_clang', status): | 190 with Step('update_clang', status): |
191 Command(context, cmd=['../tools/clang/scripts/update.sh']) | 191 Command(context, cmd=['../tools/clang/scripts/update.sh']) |
192 | 192 |
193 # Just build both bitages of validator and test for --validator mode. | 193 # Just build both bitages of validator and test for --validator mode. |
194 if context['validator']: | 194 if context['validator']: |
195 with Step('build ncval-x86-32', status): | |
196 SCons(context, platform='x86-32', parallel=True, args=['ncval']) | |
197 with Step('build ncval-x86-64', status): | |
198 SCons(context, platform='x86-64', parallel=True, args=['ncval']) | |
199 | |
200 with Step('build ragel_validator-32', status): | 195 with Step('build ragel_validator-32', status): |
201 SCons(context, platform='x86-32', parallel=True, args=['ncval_new']) | 196 SCons(context, platform='x86-32', parallel=True, args=['ncval_new']) |
202 with Step('build ragel_validator-64', status): | 197 with Step('build ragel_validator-64', status): |
203 SCons(context, platform='x86-64', parallel=True, args=['ncval_new']) | 198 SCons(context, platform='x86-64', parallel=True, args=['ncval_new']) |
204 | 199 |
205 with Step('predownload validator corpus', status): | 200 with Step('predownload validator corpus', status): |
206 Command(context, | 201 Command(context, |
207 cmd=[sys.executable, | 202 cmd=[sys.executable, |
208 'tests/abi_corpus/validator_regression_test.py', | 203 'tests/abi_corpus/validator_regression_test.py', |
209 '--download-only']) | 204 '--download-only']) |
210 | 205 |
211 with Step('validator_regression_test current x86-32', status, | |
212 halt_on_fail=False): | |
213 ValidatorTest( | |
214 context, 'x86-32', 'scons-out/opt-linux-x86-32/staging/ncval') | |
215 with Step('validator_regression_test current x86-64', status, | |
216 halt_on_fail=False): | |
217 ValidatorTest( | |
218 context, 'x86-64', 'scons-out/opt-linux-x86-64/staging/ncval') | |
219 | |
220 with Step('validator_regression_test ragel x86-32', status, | 206 with Step('validator_regression_test ragel x86-32', status, |
221 halt_on_fail=False): | 207 halt_on_fail=False): |
222 ValidatorTest( | 208 ValidatorTest( |
223 context, 'x86-32', | 209 context, 'x86-32', |
224 'scons-out/opt-linux-x86-32/staging/ncval_new') | 210 'scons-out/opt-linux-x86-32/staging/ncval_new') |
225 with Step('validator_regression_test ragel x86-64', status, | 211 with Step('validator_regression_test ragel x86-64', status, |
226 halt_on_fail=False): | 212 halt_on_fail=False): |
227 ValidatorTest( | 213 ValidatorTest( |
228 context, 'x86-64', | 214 context, 'x86-64', |
229 'scons-out/opt-linux-x86-64/staging/ncval_new') | 215 'scons-out/opt-linux-x86-64/staging/ncval_new') |
230 | 216 |
231 with Step('validator_diff32_tests', status, halt_on_fail=False): | |
232 SCons(context, platform='x86-32', args=['validator_diff_tests']) | |
233 with Step('validator_diff64_tests', status, halt_on_fail=False): | |
234 SCons(context, platform='x86-64', args=['validator_diff_tests']) | |
235 return | 217 return |
236 | 218 |
237 # Run checkdeps script to vet #includes. | 219 # Run checkdeps script to vet #includes. |
238 with Step('checkdeps', status): | 220 with Step('checkdeps', status): |
239 Command(context, cmd=[sys.executable, 'tools/checkdeps/checkdeps.py']) | 221 Command(context, cmd=[sys.executable, 'tools/checkdeps/checkdeps.py']) |
240 | 222 |
241 # Make sure our Gyp build is working. | 223 # Make sure our Gyp build is working. |
242 if not context['no_gyp']: | 224 if not context['no_gyp']: |
243 with Step('gyp_compile', status): | 225 with Step('gyp_compile', status): |
244 CommandGypBuild(context) | 226 CommandGypBuild(context) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 }[context['arch']] | 283 }[context['arch']] |
302 gn_sel_ldr = '../out/trusted_%s/sel_ldr' % arch_name | 284 gn_sel_ldr = '../out/trusted_%s/sel_ldr' % arch_name |
303 with Step('small_tests under GN', status, halt_on_fail=False): | 285 with Step('small_tests under GN', status, halt_on_fail=False): |
304 SCons(context, args=['small_tests', 'force_sel_ldr=' + gn_sel_ldr]) | 286 SCons(context, args=['small_tests', 'force_sel_ldr=' + gn_sel_ldr]) |
305 with Step('medium_tests under GN', status, halt_on_fail=False): | 287 with Step('medium_tests under GN', status, halt_on_fail=False): |
306 SCons(context, args=['medium_tests', 'force_sel_ldr=' + gn_sel_ldr]) | 288 SCons(context, args=['medium_tests', 'force_sel_ldr=' + gn_sel_ldr]) |
307 with Step('large_tests under GN', status, halt_on_fail=False): | 289 with Step('large_tests under GN', status, halt_on_fail=False): |
308 SCons(context, args=['large_tests', 'force_sel_ldr=' + gn_sel_ldr]) | 290 SCons(context, args=['large_tests', 'force_sel_ldr=' + gn_sel_ldr]) |
309 ### END GN tests ### | 291 ### END GN tests ### |
310 | 292 |
311 # Build with ragel-based validator using scons. | |
312 with Step('scons_compile_noragel', status): | |
313 SCons(context, parallel=True, args=['validator_ragel=0']) | |
314 | |
315 # Smoke tests for the R-DFA validator. | |
316 with Step('validator_noragel_tests', status): | |
317 args = ['validator_ragel=0', | |
318 'small_tests', | |
319 'medium_tests', | |
320 'large_tests', | |
321 ] | |
322 # Add nacl_irt_test mode to be able to run run_hello_world_test_irt that | |
323 # tests validation of the IRT. | |
324 SCons(context, | |
325 mode=context['default_scons_mode'] + ['nacl_irt_test'], | |
326 args=args) | |
327 | |
328 | 293 |
329 def Main(): | 294 def Main(): |
330 # TODO(ncbray) make buildbot scripts composable to support toolchain use case. | 295 # TODO(ncbray) make buildbot scripts composable to support toolchain use case. |
331 context = BuildContext() | 296 context = BuildContext() |
332 status = BuildStatus(context) | 297 status = BuildStatus(context) |
333 ParseStandardCommandLine(context) | 298 ParseStandardCommandLine(context) |
334 SetupContextVars(context) | 299 SetupContextVars(context) |
335 if context.Windows(): | 300 if context.Windows(): |
336 SetupWindowsEnvironment(context) | 301 SetupWindowsEnvironment(context) |
337 elif context.Linux(): | 302 elif context.Linux(): |
(...skipping 12 matching lines...) Expand all Loading... |
350 start_time = time.time() | 315 start_time = time.time() |
351 try: | 316 try: |
352 Main() | 317 Main() |
353 finally: | 318 finally: |
354 time_taken = time.time() - start_time | 319 time_taken = time.time() - start_time |
355 print 'RESULT BuildbotTime: total= %.3f minutes' % (time_taken / 60) | 320 print 'RESULT BuildbotTime: total= %.3f minutes' % (time_taken / 60) |
356 | 321 |
357 | 322 |
358 if __name__ == '__main__': | 323 if __name__ == '__main__': |
359 TimedMain() | 324 TimedMain() |
OLD | NEW |