Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/bash | 1 #!/bin/bash |
| 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 set -o xtrace | 6 set -o xtrace |
| 7 set -o nounset | 7 set -o nounset |
| 8 set -o errexit | 8 set -o errexit |
| 9 | 9 |
| 10 # Tell build.sh and test.sh that we're a bot. | 10 # Tell build.sh and test.sh that we're a bot. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 # TODO(mseaborn): Run small_tests_irt with nonsfi_nacl=1 when it passes, | 48 # TODO(mseaborn): Run small_tests_irt with nonsfi_nacl=1 when it passes, |
| 49 # instead of the following whitelist of tests. | 49 # instead of the following whitelist of tests. |
| 50 readonly SCONS_NONSFI_TESTS="\ | 50 readonly SCONS_NONSFI_TESTS="\ |
| 51 run_hello_world_test_irt \ | 51 run_hello_world_test_irt \ |
| 52 run_float_test_irt \ | 52 run_float_test_irt \ |
| 53 run_malloc_realloc_calloc_free_test_irt \ | 53 run_malloc_realloc_calloc_free_test_irt \ |
| 54 run_dup_test_irt \ | 54 run_dup_test_irt \ |
| 55 run_syscall_test_irt \ | 55 run_syscall_test_irt \ |
| 56 run_getpid_test_irt \ | 56 run_getpid_test_irt \ |
| 57 toolchain_tests_irt \ | 57 toolchain_tests_irt \ |
| 58 skip_nonstable_bitcode=1 \ | |
| 59 use_newlib_nonsfi_loader=0" | |
| 60 readonly SCONS_NONSFI_NEWLIB="nonsfi_nacl=1 ${SCONS_NONSFI_NEWLIB_TESTS}" | |
| 61 readonly SCONS_NONSFI="nonsfi_nacl=1 ${SCONS_NONSFI_TESTS}" | |
| 62 # Extra non-IRT-using test to run for x86-32 and ARM on toolchain bots. | |
| 63 # TODO(mseaborn): Run this on the main bots after the toolchain revision is | |
| 64 # updated. | |
| 65 readonly SCONS_NONSFI_TC="\ | |
|
Mark Seaborn
2014/07/28 21:12:31
This overlaps with Hidehiko's change (https://code
Derek Schuff
2014/07/28 21:16:05
Acknowledged.
| |
| 66 ${SCONS_NONSFI} \ | |
| 67 run_clock_get_test \ | 58 run_clock_get_test \ |
| 68 run_dup_test \ | 59 run_dup_test \ |
| 69 run_fcntl_test \ | 60 run_fcntl_test \ |
| 70 run_fork_test \ | 61 run_fork_test \ |
| 71 run_hello_world_test \ | 62 run_hello_world_test \ |
| 72 run_mmap_test \ | |
| 73 run_nanosleep_test \ | 63 run_nanosleep_test \ |
| 74 run_prctl_test \ | 64 run_prctl_test \ |
| 75 run_printf_test \ | 65 run_printf_test \ |
| 76 run_pwrite_test \ | 66 run_pwrite_test \ |
| 77 run_socket_test \ | |
| 78 run_stack_alignment_test \ | 67 run_stack_alignment_test \ |
| 79 run_syscall_test" | 68 run_syscall_test \ |
| 69 skip_nonstable_bitcode=1 \ | |
| 70 use_newlib_nonsfi_loader=0" | |
| 71 readonly SCONS_NONSFI_NEWLIB="nonsfi_nacl=1 ${SCONS_NONSFI_NEWLIB_TESTS}" | |
| 72 readonly SCONS_NONSFI="nonsfi_nacl=1 ${SCONS_NONSFI_TESTS}" | |
| 80 | 73 |
| 81 # subset of tests used on toolchain builders | 74 # subset of tests used on toolchain builders |
| 82 readonly SCONS_TC_TESTS="small_tests medium_tests" | 75 readonly SCONS_TC_TESTS="small_tests medium_tests" |
| 83 | 76 |
| 84 readonly SCONS_COMMON="./scons --verbose bitcode=1" | 77 readonly SCONS_COMMON="./scons --verbose bitcode=1" |
| 85 readonly UP_DOWN_LOAD="buildbot/file_up_down_load.sh" | 78 readonly UP_DOWN_LOAD="buildbot/file_up_down_load.sh" |
| 86 # This script is used by toolchain bots (i.e. tc-xxx functions) | 79 # This script is used by toolchain bots (i.e. tc-xxx functions) |
| 87 readonly PNACL_BUILD="pnacl/build.sh" | 80 readonly PNACL_BUILD="pnacl/build.sh" |
| 88 readonly DRIVER_TESTS="pnacl/driver/tests/driver_tests.py" | 81 readonly DRIVER_TESTS="pnacl/driver/tests/driver_tests.py" |
| 82 readonly BUILDBOT_PNACL_PY="buildbot/buildbot_pnacl.py" | |
| 89 | 83 |
| 90 | 84 |
| 91 tc-build-translator() { | 85 tc-build-translator() { |
| 92 echo @@@BUILD_STEP compile_translator@@@ | 86 echo @@@BUILD_STEP compile_translator@@@ |
| 93 ${PNACL_BUILD} translator-clean-all | 87 ${PNACL_BUILD} translator-clean-all |
| 94 ${PNACL_BUILD} translator-all | 88 ${PNACL_BUILD} translator-all |
| 95 } | 89 } |
| 96 | 90 |
| 97 tc-prune-translator-pexes() { | 91 tc-prune-translator-pexes() { |
| 98 echo @@@BUILD_STEP prune_translator_pexe@@@ | 92 echo @@@BUILD_STEP prune_translator_pexe@@@ |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 "${hwflags} use_sandboxed_translator=1 translate_fast=1 \ | 370 "${hwflags} use_sandboxed_translator=1 translate_fast=1 \ |
| 377 translate_in_build_step=0" \ | 371 translate_in_build_step=0" \ |
| 378 "toolchain_tests" | 372 "toolchain_tests" |
| 379 | 373 |
| 380 # Test Non-SFI Mode. | 374 # Test Non-SFI Mode. |
| 381 scons-stage-irt "arm" "${hwflags}" "${SCONS_NONSFI_NEWLIB}" | 375 scons-stage-irt "arm" "${hwflags}" "${SCONS_NONSFI_NEWLIB}" |
| 382 scons-stage-irt "arm" "${hwflags}" "${SCONS_NONSFI}" | 376 scons-stage-irt "arm" "${hwflags}" "${SCONS_NONSFI}" |
| 383 } | 377 } |
| 384 | 378 |
| 385 mode-trybot-qemu() { | 379 mode-trybot-qemu() { |
| 386 # Build and actually run the arm tests under qemu, except | |
| 387 # sandboxed translation. Hopefully that's a good tradeoff between | |
| 388 # flakiness and cycle time. | |
| 389 FAIL_FAST=false | |
| 390 local qemuflags="-j4 -k" | |
| 391 clobber | 380 clobber |
| 381 # TODO(dschuff): move the gyp build to buildbot_pnacl.py | |
| 392 gyp-arm-build | 382 gyp-arm-build |
| 393 | 383 |
| 394 scons-stage-noirt "arm" "${qemuflags}" "${SCONS_EVERYTHING}" | 384 ${BUILDBOT_PNACL_PY} opt arm pnacl |
| 395 # Large tests cannot be run in parallel | |
| 396 scons-stage-noirt "arm" "${qemuflags} -j1" "${SCONS_S_M} large_tests" | |
| 397 | |
| 398 # also run some tests with the irt | |
| 399 scons-stage-irt "arm" "${qemuflags}" "${SCONS_S_M_IRT}" | |
| 400 | |
| 401 # non-pexe tests | |
| 402 scons-stage-noirt "arm" "${qemuflags} pnacl_generate_pexe=0" "nonpexe_tests" | |
| 403 | |
| 404 # Test Non-SFI Mode. | |
| 405 scons-stage-irt "arm" "${qemuflags}" "${SCONS_NONSFI_NEWLIB}" | |
| 406 scons-stage-irt "arm" "${qemuflags}" "${SCONS_NONSFI}" | |
| 407 } | 385 } |
| 408 | 386 |
| 409 mode-buildbot-arm-dbg() { | 387 mode-buildbot-arm-dbg() { |
| 410 BUILD_MODE_HOST=DEDUG | 388 BUILD_MODE_HOST=DEDUG |
| 411 mode-buildbot-arm | 389 mode-buildbot-arm |
| 412 archive-for-hw-bots $(NAME_ARM_UPLOAD) regular | 390 archive-for-hw-bots $(NAME_ARM_UPLOAD) regular |
| 413 } | 391 } |
| 414 | 392 |
| 415 mode-buildbot-arm-opt() { | 393 mode-buildbot-arm-opt() { |
| 416 mode-buildbot-arm | 394 mode-buildbot-arm |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 443 # These 2 functions are also suitable for local TC sanity testing. | 421 # These 2 functions are also suitable for local TC sanity testing. |
| 444 tc-tests-all() { | 422 tc-tests-all() { |
| 445 local is_try=$1 | 423 local is_try=$1 |
| 446 | 424 |
| 447 local label="pnacl_newlib_dir=toolchain/${PNACL_TOOLCHAIN_DIR}" | 425 local label="pnacl_newlib_dir=toolchain/${PNACL_TOOLCHAIN_DIR}" |
| 448 local scons_flags="-k skip_trusted_tests=1 -j8 ${label}" | 426 local scons_flags="-k skip_trusted_tests=1 -j8 ${label}" |
| 449 | 427 |
| 450 # newlib | 428 # newlib |
| 451 for arch in x86-32 x86-64 arm; do | 429 for arch in x86-32 x86-64 arm; do |
| 452 driver-tests "${arch}" | 430 driver-tests "${arch}" |
| 453 scons-stage-noirt "$arch" "${scons_flags}" "${SCONS_TC_TESTS}" | |
| 454 # Large tests cannot be run in parallel | |
| 455 scons-stage-noirt "$arch" "${scons_flags} -j1" "large_tests" | |
| 456 scons-stage-noirt "$arch" "${scons_flags} pnacl_generate_pexe=0" \ | |
| 457 "nonpexe_tests" | |
| 458 done | 431 done |
| 459 | 432 |
| 460 # Small set of sbtc tests w/ and without translate_fast=1. | 433 # All the SCons tests (the same ones run by the main waterfall bot) |
| 461 scons-stage-irt "x86-32" "${scons_flags} use_sandboxed_translator=1" \ | 434 for arch in 32 64 arm; do |
| 462 "toolchain_tests" | 435 ${BUILDBOT_PNACL_PY} opt "${arch}" pnacl |
| 463 scons-stage-irt "x86-32" \ | 436 done |
| 464 "${scons_flags} use_sandboxed_translator=1 translate_fast=1" \ | |
| 465 "toolchain_tests" | |
| 466 scons-stage-irt "x86-64" "${scons_flags} use_sandboxed_translator=1" \ | |
| 467 "toolchain_tests" | |
| 468 scons-stage-irt "x86-64" \ | |
| 469 "${scons_flags} use_sandboxed_translator=1 translate_fast=1" \ | |
| 470 "toolchain_tests" | |
| 471 # Smaller set of sbtc tests for ARM because qemu is flaky. | |
| 472 scons-stage-irt "arm" "${scons_flags} use_sandboxed_translator=1" \ | |
| 473 "run_hello_world_test" | |
| 474 scons-stage-irt "arm" \ | |
| 475 "${scons_flags} use_sandboxed_translator=1 translate_fast=1" \ | |
| 476 "run_hello_world_test" | |
| 477 | |
| 478 # Test Non-SFI Mode. | |
| 479 scons-stage-irt "x86-32" "${scons_flags}" "${SCONS_NONSFI_TC}" | |
| 480 scons-stage-irt "arm" "${scons_flags}" "${SCONS_NONSFI_TC}" | |
| 481 | |
| 482 # Test unsandboxed mode. | |
| 483 scons-stage-irt "x86-32" "${scons_flags}" "pnacl_unsandboxed=1" \ | |
| 484 "run_hello_world_test_irt" | |
| 485 | 437 |
| 486 # Run the GCC torture tests just for x86-32. Testing a single | 438 # Run the GCC torture tests just for x86-32. Testing a single |
| 487 # architecture gives good coverage without taking too long. We | 439 # architecture gives good coverage without taking too long. We |
| 488 # don't test x86-64 here because some of the torture tests fail on | 440 # don't test x86-64 here because some of the torture tests fail on |
| 489 # the x86-64 toolchain trybot (though not the buildbots, apparently | 441 # the x86-64 toolchain trybot (though not the buildbots, apparently |
| 490 # due to a hardware difference: | 442 # due to a hardware difference: |
| 491 # https://code.google.com/p/nativeclient/issues/detail?id=3697). | 443 # https://code.google.com/p/nativeclient/issues/detail?id=3697). |
| 492 # Build the SDK libs first so that linking will succeed. | 444 # Build the SDK libs first so that linking will succeed. |
| 493 echo "@@@BUILD_STEP sdk libs @@@" | 445 echo "@@@BUILD_STEP sdk libs @@@" |
| 494 ${PNACL_BUILD} sdk | 446 ${PNACL_BUILD} sdk |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 559 exit 1 | 511 exit 1 |
| 560 fi | 512 fi |
| 561 | 513 |
| 562 "$@" | 514 "$@" |
| 563 | 515 |
| 564 if [[ ${RETCODE} != 0 ]]; then | 516 if [[ ${RETCODE} != 0 ]]; then |
| 565 echo "@@@BUILD_STEP summary@@@" | 517 echo "@@@BUILD_STEP summary@@@" |
| 566 echo There were failed stages. | 518 echo There were failed stages. |
| 567 exit ${RETCODE} | 519 exit ${RETCODE} |
| 568 fi | 520 fi |
| OLD | NEW |