| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2013 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2013 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 import os | 6 import os |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 from buildbot_lib import ( | 9 from buildbot_lib import ( |
| 10 BuildContext, BuildStatus, Command, ParseStandardCommandLine, | 10 BuildContext, BuildStatus, Command, ParseStandardCommandLine, |
| 11 RemoveSconsBuildDirectories, RunBuild, SetupLinuxEnvironment, | 11 RemoveSconsBuildDirectories, RunBuild, SetupLinuxEnvironment, |
| 12 SetupMacEnvironment, SetupWindowsEnvironment, SCons, Step ) | 12 SetupMacEnvironment, SetupWindowsEnvironment, SCons, Step ) |
| 13 | 13 |
| 14 sys.path.append(os.path.join(os.path.dirname(__file__), '..')) | 14 sys.path.append(os.path.join(os.path.dirname(__file__), '..')) |
| 15 import pynacl.platform | 15 import pynacl.platform |
| 16 | 16 |
| 17 def RunSconsTests(status, context): | 17 def RunSconsTests(status, context): |
| 18 # Clean out build directories, unless we have built elsewhere. | 18 # Clean out build directories, unless we have built elsewhere. |
| 19 if not context['skip_build']: | 19 if not context['skip_build']: |
| 20 with Step('clobber scons', status): | 20 with Step('clobber scons', status): |
| 21 RemoveSconsBuildDirectories() | 21 RemoveSconsBuildDirectories() |
| 22 | 22 |
| 23 # Run checkdeps script to vet #includes. | 23 # Run checkdeps script to vet #includes. |
| 24 with Step('checkdeps', status): | 24 with Step('checkdeps', status): |
| 25 Command(context, cmd=[sys.executable, 'tools/checkdeps/checkdeps.py']) | 25 Command(context, cmd=[sys.executable, 'tools/checkdeps/checkdeps.py']) |
| 26 | 26 |
| 27 arch = context['default_scons_platform'] | 27 arch = context['default_scons_platform'] |
| 28 | 28 |
| 29 flags_subzero = ['use_sz=1'] |
| 29 flags_build = ['do_not_run_tests=1'] | 30 flags_build = ['do_not_run_tests=1'] |
| 30 flags_run = [] | 31 flags_run = [] |
| 31 | 32 |
| 32 # This file is run 3 different ways for ARM builds. The qemu-only trybot does | 33 # This file is run 3 different ways for ARM builds. The qemu-only trybot does |
| 33 # a normal build-and-run with the emulator just like the x86 bots. The panda | 34 # a normal build-and-run with the emulator just like the x86 bots. The panda |
| 34 # build side runs on an x86 machines with skip_run, and then packs up the | 35 # build side runs on an x86 machines with skip_run, and then packs up the |
| 35 # result and triggers an ARM hardware tester that run with skip_build | 36 # result and triggers an ARM hardware tester that run with skip_build |
| 36 if arch != 'arm': | 37 if arch != 'arm': |
| 37 # Unlike their arm counterparts we do not run trusted tests on x86 bots. | 38 # Unlike their arm counterparts we do not run trusted tests on x86 bots. |
| 38 # Trusted tests get plenty of coverage by other bots, e.g. nacl-gcc bots. | 39 # Trusted tests get plenty of coverage by other bots, e.g. nacl-gcc bots. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 52 flags_run.extend(['naclsdk_validate=0', 'built_elsewhere=1']) | 53 flags_run.extend(['naclsdk_validate=0', 'built_elsewhere=1']) |
| 53 | 54 |
| 54 if not context['skip_build']: | 55 if not context['skip_build']: |
| 55 # For ARM builders which will trigger hardware testers, run the hello world | 56 # For ARM builders which will trigger hardware testers, run the hello world |
| 56 # test with the emulator as a basic sanity check before doing anything else. | 57 # test with the emulator as a basic sanity check before doing anything else. |
| 57 if arch == 'arm' and context['skip_run']: | 58 if arch == 'arm' and context['skip_run']: |
| 58 with Step('hello_world ' + arch, status): | 59 with Step('hello_world ' + arch, status): |
| 59 SCons(context, parallel=True, args=['run_hello_world_test']) | 60 SCons(context, parallel=True, args=['run_hello_world_test']) |
| 60 with Step('build_all ' + arch, status): | 61 with Step('build_all ' + arch, status): |
| 61 SCons(context, parallel=True, args=flags_build) | 62 SCons(context, parallel=True, args=flags_build) |
| 63 if arch == 'x86-32': |
| 64 with Step('build_all subzero ' + arch, status): |
| 65 SCons(context, parallel=True, args=flags_build + flags_subzero) |
| 62 | 66 |
| 63 smoke_tests = ['small_tests', 'medium_tests'] | 67 smoke_tests = ['small_tests', 'medium_tests'] |
| 64 # Normal pexe-mode tests | 68 # Normal pexe-mode tests |
| 65 with Step('smoke_tests ' + arch, status, halt_on_fail=False): | 69 with Step('smoke_tests ' + arch, status, halt_on_fail=False): |
| 66 SCons(context, parallel=True, args=flags_run + smoke_tests) | 70 SCons(context, parallel=True, args=flags_run + smoke_tests) |
| 67 # Large tests cannot be run in parallel | 71 # Large tests cannot be run in parallel |
| 68 with Step('large_tests ' + arch, status, halt_on_fail=False): | 72 with Step('large_tests ' + arch, status, halt_on_fail=False): |
| 69 SCons(context, parallel=False, args=flags_run + ['large_tests']) | 73 SCons(context, parallel=False, args=flags_run + ['large_tests']) |
| 74 # Run small_tests, medium_tests, and large_tests with Subzero. |
| 75 # TODO(stichnot): Move this to the sandboxed translator section |
| 76 # along with the translate_fast flag once pnacl-sz.nexe is ready. |
| 77 if arch == 'x86-32': |
| 78 # Normal pexe-mode tests |
| 79 with Step('smoke_tests subzero ' + arch, status, halt_on_fail=False): |
| 80 SCons(context, parallel=True, |
| 81 args=flags_run + flags_subzero + smoke_tests) |
| 82 # Large tests cannot be run in parallel |
| 83 with Step('large_tests subzero ' + arch, status, halt_on_fail=False): |
| 84 SCons(context, parallel=False, |
| 85 args=flags_run + flags_subzero + ['large_tests']) |
| 70 | 86 |
| 71 with Step('nonpexe_tests ' + arch, status, halt_on_fail=False): | 87 with Step('nonpexe_tests ' + arch, status, halt_on_fail=False): |
| 72 SCons(context, parallel=True, | 88 SCons(context, parallel=True, |
| 73 args=flags_run + ['pnacl_generate_pexe=0', 'nonpexe_tests']) | 89 args=flags_run + ['pnacl_generate_pexe=0', 'nonpexe_tests']) |
| 74 | 90 |
| 75 irt_mode = context['default_scons_mode'] + ['nacl_irt_test'] | 91 irt_mode = context['default_scons_mode'] + ['nacl_irt_test'] |
| 76 # Build all the tests with the IRT | 92 # Build all the tests with the IRT |
| 77 if not context['skip_build']: | 93 if not context['skip_build']: |
| 78 with Step('build_all_irt ' + arch, status): | 94 with Step('build_all_irt ' + arch, status): |
| 79 SCons(context, parallel=True, mode=irt_mode, args=flags_build) | 95 SCons(context, parallel=True, mode=irt_mode, args=flags_build) |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 raise Exception('Unsupported platform') | 225 raise Exception('Unsupported platform') |
| 210 | 226 |
| 211 # Panda bots only have 2 cores. | 227 # Panda bots only have 2 cores. |
| 212 if pynacl.platform.GetArch() == 'arm': | 228 if pynacl.platform.GetArch() == 'arm': |
| 213 context['max_jobs'] = 2 | 229 context['max_jobs'] = 2 |
| 214 | 230 |
| 215 RunBuild(RunSconsTests, status) | 231 RunBuild(RunSconsTests, status) |
| 216 | 232 |
| 217 if __name__ == '__main__': | 233 if __name__ == '__main__': |
| 218 Main() | 234 Main() |
| OLD | NEW |