Chromium Code Reviews| 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 | |
| 7 | |
| 8 from buildbot_lib import ( | 6 from buildbot_lib import ( |
| 9 BuildContext, BuildStatus, ParseStandardCommandLine, | 7 BuildContext, BuildStatus, ParseStandardCommandLine, |
| 10 RemoveSconsBuildDirectories, RemoveGypBuildDirectories, RunBuild, | 8 RemoveSconsBuildDirectories, RunBuild, SetupLinuxEnvironment, |
| 11 SetupLinuxEnvironment, SetupMacEnvironment, SetupWindowsEnvironment, SCons, | 9 SetupMacEnvironment, SetupWindowsEnvironment, SCons, Step ) |
| 12 Step ) | |
| 13 | 10 |
| 14 | 11 |
| 15 | 12 def RunSconsTests(status, context): |
| 16 def BuildScriptX86(status, context): | |
| 17 # Clean out build directories. | 13 # Clean out build directories. |
| 18 with Step('clobber', status): | 14 with Step('clobber scons', status): |
| 19 RemoveSconsBuildDirectories() | 15 RemoveSconsBuildDirectories() |
| 20 RemoveGypBuildDirectories() | |
|
Mark Seaborn
2014/07/28 21:12:31
What's the reason for removing this? It doesn't s
Derek Schuff
2014/07/28 21:16:05
There's no gyp build anywhere in this script.
| |
| 21 | 16 |
| 22 # Unlike their arm counterparts we do not run trusted tests on x86 bots. | 17 # Unlike their arm counterparts we do not run trusted tests on x86 bots. |
| 23 # Trusted tests get plenty of coverage by other bots, e.g. nacl-gcc bots. | 18 # Trusted tests get plenty of coverage by other bots, e.g. nacl-gcc bots. |
| 24 # We make the assumption here that there are no "exotic tests" which | 19 # We make the assumption here that there are no "exotic tests" which |
| 25 # are trusted in nature but are somehow depedent on the untrusted TC. | 20 # are trusted in nature but are somehow depedent on the untrusted TC. |
| 26 flags_build = ['skip_trusted_tests=1', 'do_not_run_tests=1'] | 21 flags_build = ['skip_trusted_tests=1', 'do_not_run_tests=1'] |
| 27 flags_run = ['skip_trusted_tests=1'] | 22 flags_run = ['skip_trusted_tests=1'] |
| 28 smoke_tests = ['small_tests', 'medium_tests'] | 23 smoke_tests = ['small_tests', 'medium_tests'] |
| 29 | 24 |
| 30 with Step('build_all', status): | 25 with Step('build_all', status): |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 54 | 49 |
| 55 # Test sandboxed translation | 50 # Test sandboxed translation |
| 56 if not context.Windows() and not context.Mac(): | 51 if not context.Windows() and not context.Mac(): |
| 57 # TODO(dschuff): The standalone sandboxed translator driver does not have | 52 # TODO(dschuff): The standalone sandboxed translator driver does not have |
| 58 # the batch script wrappers, so it can't run on Windows. Either add them to | 53 # the batch script wrappers, so it can't run on Windows. Either add them to |
| 59 # the translator package or make SCons use the pnacl_newlib drivers except | 54 # the translator package or make SCons use the pnacl_newlib drivers except |
| 60 # on the ARM bots where we don't have the pnacl_newlib drivers. | 55 # on the ARM bots where we don't have the pnacl_newlib drivers. |
| 61 # The mac standalone sandboxed translator is flaky. | 56 # The mac standalone sandboxed translator is flaky. |
| 62 # https://code.google.com/p/nativeclient/issues/detail?id=3856 | 57 # https://code.google.com/p/nativeclient/issues/detail?id=3856 |
| 63 | 58 |
| 64 with Step('toolchain_tests_sandboxed_translator', status, | 59 if context['default_scons_platform'] == 'arm': |
| 60 # The ARM sandboxed translator is flaky under qemu. | |
| 61 sbtc_tests = 'run_hello_world_test' | |
| 62 else: | |
| 63 sbtc_tests = 'toolchain_tests' | |
| 64 | |
| 65 with Step(sbtc_tests + '_sandboxed_translator', status, | |
| 65 halt_on_fail=False): | 66 halt_on_fail=False): |
| 66 SCons(context, parallel=True, mode=irt_mode, | 67 SCons(context, parallel=True, mode=irt_mode, |
| 67 args=flags_run + ['use_sandboxed_translator=1', | 68 args=flags_run + ['use_sandboxed_translator=1', |
| 68 'toolchain_tests_irt']) | 69 sbtc_tests + '_irt']) |
| 69 with Step('toolchain_tests_sandboxed_fast', status, halt_on_fail=False): | 70 with Step(sbtc_tests + '_sandboxed_fast', status, halt_on_fail=False): |
| 70 SCons(context, parallel=True, mode=irt_mode, | 71 SCons(context, parallel=True, mode=irt_mode, |
| 71 args=flags_run + ['use_sandboxed_translator=1', 'translate_fast=1', | 72 args=flags_run + ['use_sandboxed_translator=1', 'translate_fast=1', |
| 72 'toolchain_tests_irt']) | 73 sbtc_tests + '_irt']) |
| 73 | 74 |
| 74 # Translator memory consumption regression test | 75 # Translator memory consumption regression test |
| 75 with Step('large_code_test', status, halt_on_fail=False): | 76 with Step('large_code_test', status, halt_on_fail=False): |
| 76 SCons(context, parallel=True, mode=irt_mode, | 77 SCons(context, parallel=True, mode=irt_mode, |
| 77 args=flags_run + ['use_sandboxed_translator=1', 'large_code']) | 78 args=flags_run + ['use_sandboxed_translator=1', 'large_code']) |
| 78 | 79 |
| 79 # Test Non-SFI Mode. | 80 if context.Linux() and (context['default_scons_platform'] == 'x86-32' or |
| 80 # The only architectures that the PNaCl toolchain supports Non-SFI | 81 context['default_scons_platform'] == 'arm'): |
| 81 # versions of are currently x86-32 and ARM, and ARM testing is covered | 82 # Test Non-SFI Mode. |
| 82 # by buildbot_pnacl.sh rather than this Python script. | 83 # The only architectures that the PNaCl toolchain supports Non-SFI |
| 83 # The x86-64 toolchain bot currently also runs these tests from | 84 # versions of are currently x86-32 and ARM, and ARM testing is covered |
| 84 # buildbot_pnacl.sh | 85 # by buildbot_pnacl.sh rather than this Python script. |
| 85 if context.Linux() and context['default_scons_platform'] == 'x86-32': | 86 # The x86-64 toolchain bot also runs these tests from buildbot_pnacl.sh |
| 86 with Step('nonsfi_tests', status, halt_on_fail=False): | 87 |
| 87 # TODO(mseaborn): Enable more tests here when they pass. | 88 # TODO(mseaborn): Run small_tests_irt with nonsfi_nacl=1 when it passes, |
| 88 tests = ['run_' + test + '_test_irt' for test in | 89 # instead of the following whitelists of tests. |
| 89 ['float', | 90 # These tests pass with both host libc and newlib, on x86-32 and ARM. |
| 90 'hello_world', | 91 nonsfi_tests_common = ['run_' + test + '_test_irt' for test in |
| 91 'irt_futex', | 92 'dup', |
| 92 'malloc_realloc_calloc_free', | 93 'float', |
| 93 'stack_alignment', | 94 'hello_world' |
| 94 'syscall', | 95 'malloc_realloc_calloc_free', |
| 95 'thread']] | 96 'stack_alignment', |
| 96 # Extra non-IRT-using test to run for x86-32 | 97 'syscall'] |
| 97 tests.extend(['run_clock_get_test', | 98 # These tests pass with the host libc, on x86-32 and ARM. |
| 98 'run_dup_test', | 99 nonsfi_tests_host_libc = (nonsfi_tests_common + |
| 99 'run_fcntl_test', | 100 ['run_getpid_test_irt', 'toolchain_tests_irt'] + |
| 100 'run_fork_test', | 101 ['run_' + test + 'test' for test in |
| 101 'run_hello_world_test', | 102 'clock_get', |
| 102 'run_mmap_test', | 103 'dup', |
| 103 'run_nanosleep_test', | 104 'fcntl', |
| 104 'run_prctl_test', | 105 'fork', |
| 105 'run_printf_test', | 106 'hello_world', |
| 106 'run_pwrite_test', | 107 'nanosleep', |
| 107 'run_socket_test', | 108 'prctl', |
| 108 'run_stack_alignment_test', | 109 'printf', |
| 109 'run_syscall_test', | 110 'pwrite', |
| 110 'run_thread_test']) | 111 'stack_alignment', |
| 111 SCons(context, parallel=True, mode=irt_mode, | 112 'syscall']) |
| 112 args=flags_run + ['nonsfi_nacl=1'] + tests) | 113 # These tests pass (with host libc) on x86-32 but not ARM |
| 114 nonsfi_tests_host_libc_x8632 = (nonsfi_tests_host_libc + | |
| 115 ['run_mmap_test', 'run_socket_test']) | |
| 116 if context['default_scons_platform'] == 'x86-32': | |
| 117 # This uses the newlib-based nonsfi_loader, for which only a subset of | |
| 118 # the tests works so far. | |
| 119 # TODO(hamaji): Enable more tests. | |
| 120 with Step('nonsfi_tests_newlib', status, halt_on_fail=False): | |
| 121 SCons(context, parallel=True, mode=irt_mode, | |
| 122 args=flags_run + ['nonsfi_nacl=1'] + nonsfi_tests_common) | |
| 123 | |
| 124 # Use x86-32 host libc tests below. | |
| 125 host_libc_tests = nonsfi_tests_host_libc_x8632 | |
| 126 else: | |
| 127 # Use ARM host libc tests below. | |
| 128 host_libc_tests = nonsfi_tests_host_libc | |
| 113 | 129 |
| 114 # Test nonsfi_loader linked against host's libc. | 130 # Test nonsfi_loader linked against host's libc. |
| 115 with Step('nonsfi_tests_host_libc', status, halt_on_fail=False): | 131 with Step('nonsfi_tests_host_libc', status, halt_on_fail=False): |
| 116 tests = ['run_' + test + '_test_irt' for test in | |
| 117 ['dup', | |
| 118 'float', | |
| 119 'getpid', | |
| 120 'hello_world', | |
| 121 'irt_futex', | |
| 122 'malloc_realloc_calloc_free', | |
| 123 'syscall', | |
| 124 'thread']] | |
| 125 # Using skip_nonstable_bitcode=1 here disables the tests for | 132 # Using skip_nonstable_bitcode=1 here disables the tests for |
| 126 # zero-cost C++ exception handling, which don't pass for Non-SFI | 133 # zero-cost C++ exception handling, which don't pass for Non-SFI |
| 127 # mode yet because we don't build libgcc_eh for Non-SFI mode. | 134 # mode yet because we don't build libgcc_eh for Non-SFI mode. |
| 128 tests.extend(['toolchain_tests_irt', | |
| 129 'skip_nonstable_bitcode=1']) | |
| 130 SCons(context, parallel=True, mode=irt_mode, | 135 SCons(context, parallel=True, mode=irt_mode, |
| 131 args=(flags_run + ['nonsfi_nacl=1', 'use_newlib_nonsfi_loader=0'] + | 136 args=(flags_run + ['nonsfi_nacl=1', |
| 132 tests)) | 137 'skip_nonstable_bitcode=1', |
| 138 'use_newlib_nonsfi_loader=0'] + | |
| 139 host_libc_tests)) | |
| 133 | 140 |
| 134 # Test unsandboxed mode. | 141 # Test unsandboxed mode. |
| 135 if ((context.Linux() or context.Mac()) and | 142 if ((context.Linux() or context.Mac()) and |
| 136 context['default_scons_platform'] == 'x86-32'): | 143 context['default_scons_platform'] == 'x86-32'): |
| 137 if context.Linux(): | 144 if context.Linux(): |
| 138 tests = ['run_' + test + '_test_irt' for test in | 145 tests = ['run_' + test + '_test_irt' for test in |
| 139 ['hello_world', 'irt_futex', 'thread', 'float', | 146 ['hello_world', 'irt_futex', 'thread', 'float', |
| 140 'malloc_realloc_calloc_free', 'dup', 'cond_timedwait', | 147 'malloc_realloc_calloc_free', 'dup', 'cond_timedwait', |
| 141 'getpid']] | 148 'getpid']] |
| 142 else: | 149 else: |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 155 | 162 |
| 156 if context.Linux(): | 163 if context.Linux(): |
| 157 SetupLinuxEnvironment(context) | 164 SetupLinuxEnvironment(context) |
| 158 elif context.Windows(): | 165 elif context.Windows(): |
| 159 SetupWindowsEnvironment(context) | 166 SetupWindowsEnvironment(context) |
| 160 elif context.Mac(): | 167 elif context.Mac(): |
| 161 SetupMacEnvironment(context) | 168 SetupMacEnvironment(context) |
| 162 else: | 169 else: |
| 163 raise Exception('Unsupported platform') | 170 raise Exception('Unsupported platform') |
| 164 | 171 |
| 165 RunBuild(BuildScriptX86, status) | 172 RunBuild(RunSconsTests, status) |
| 166 | 173 |
| 167 if __name__ == '__main__': | 174 if __name__ == '__main__': |
| 168 Main() | 175 Main() |
| OLD | NEW |