| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # This script makes autotest client tests inside a chroot environment. The idea | 7 # This script makes autotest client tests inside a chroot environment. The idea |
| 8 # is to compile any platform-dependent autotest client tests in the build | 8 # is to compile any platform-dependent autotest client tests in the build |
| 9 # environment, since client systems under test lack the proper toolchain. | 9 # environment, since client systems under test lack the proper toolchain. |
| 10 # | 10 # |
| 11 # The user can later run autotest against an ssh enabled test client system, or | 11 # The user can later run autotest against an ssh enabled test client system, or |
| 12 # install the compiled client tests directly onto the rootfs image. | 12 # install the compiled client tests directly onto the rootfs image. |
| 13 | 13 |
| 14 # Includes common already | 14 # Includes common already |
| 15 . "$(dirname $0)/autotest_lib.sh" | 15 . "$(dirname $0)/autotest_lib.sh" |
| 16 | 16 |
| 17 # Script must be run inside the chroot | 17 # Script must be run inside the chroot |
| 18 assert_inside_chroot | 18 assert_inside_chroot |
| 19 | 19 |
| 20 DEFAULT_TESTS_LIST="all" | 20 DEFAULT_TESTS_LIST="all" |
| 21 | 21 |
| 22 DEFINE_string build "${DEFAULT_TESTS_LIST}" \ | 22 DEFINE_string build "${DEFAULT_TESTS_LIST}" \ |
| 23 "a comma seperated list of autotest client tests to be prebuilt." b | 23 "a comma seperated list of autotest client tests to be prebuilt." b |
| 24 DEFINE_boolean prompt $FLAGS_TRUE "Prompt user when building all tests." | 24 DEFINE_boolean prompt $FLAGS_TRUE "Prompt user when building all tests." |
| 25 DEFINE_boolean autox $FLAGS_TRUE "Build autox along with autotest" | 25 DEFINE_boolean autox $FLAGS_TRUE "Build autox along with autotest" |
| 26 DEFINE_boolean buildcheck $FLAGS_TRUE "Fail if tests fail to build" | 26 DEFINE_boolean buildcheck $FLAGS_TRUE "Fail if tests fail to build" |
| 27 DEFINE_integer jobs -1 "How many packages to build in parallel at maximum." |
| 27 | 28 |
| 28 # More useful help | 29 # More useful help |
| 29 FLAGS_HELP="usage: $0 [flags]" | 30 FLAGS_HELP="usage: $0 [flags]" |
| 30 | 31 |
| 31 # parse the command-line | 32 # parse the command-line |
| 32 FLAGS "$@" || exit 1 | 33 FLAGS "$@" || exit 1 |
| 33 eval set -- "${FLAGS_ARGV}" | 34 eval set -- "${FLAGS_ARGV}" |
| 34 set -e | 35 set -e |
| 35 | 36 |
| 36 check_board | 37 check_board |
| 37 | 38 |
| 39 if [[ "${FLAGS_jobs}" -ne -1 ]]; then |
| 40 EMERGE_JOBS="--jobs=${FLAGS_jobs}" |
| 41 fi |
| 42 |
| 38 # build default pre-compile client tests list. | 43 # build default pre-compile client tests list. |
| 39 ALL_TESTS="compilebench,dbench,disktest,ltp,netperf2,unixbench" | 44 ALL_TESTS="compilebench,dbench,disktest,ltp,netperf2,unixbench" |
| 40 CLIENT_TEST_PATH="../third_party/autotest/files/client/site_tests" | 45 CLIENT_TEST_PATH="../third_party/autotest/files/client/site_tests" |
| 41 for SITE_TEST in ${CLIENT_TEST_PATH}/* | 46 for SITE_TEST in ${CLIENT_TEST_PATH}/* |
| 42 do | 47 do |
| 43 if [ -d ${SITE_TEST} ] | 48 if [ -d ${SITE_TEST} ] |
| 44 then | 49 then |
| 45 ALL_TESTS="${ALL_TESTS},${SITE_TEST##${CLIENT_TEST_PATH}/}" | 50 ALL_TESTS="${ALL_TESTS},${SITE_TEST##${CLIENT_TEST_PATH}/}" |
| 46 fi | 51 fi |
| 47 done | 52 done |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 TEST_LIST=${FLAGS_build} | 87 TEST_LIST=${FLAGS_build} |
| 83 fi | 88 fi |
| 84 | 89 |
| 85 # Decide on USE flags based on options | 90 # Decide on USE flags based on options |
| 86 USE= | 91 USE= |
| 87 [ $FLAGS_autox -eq "$FLAGS_FALSE" ] && USE="${USE} -autox" | 92 [ $FLAGS_autox -eq "$FLAGS_FALSE" ] && USE="${USE} -autox" |
| 88 [ $FLAGS_buildcheck -eq "$FLAGS_TRUE" ] && USE="${USE} buildcheck" | 93 [ $FLAGS_buildcheck -eq "$FLAGS_TRUE" ] && USE="${USE} buildcheck" |
| 89 | 94 |
| 90 GCLIENT_ROOT="${GCLIENT_ROOT}" TEST_LIST=${TEST_LIST} \ | 95 GCLIENT_ROOT="${GCLIENT_ROOT}" TEST_LIST=${TEST_LIST} \ |
| 91 FEATURES="${FEATURES} -buildpkg" USE="$USE" "emerge-${FLAGS_board}" \ | 96 FEATURES="${FEATURES} -buildpkg" USE="$USE" "emerge-${FLAGS_board}" \ |
| 92 chromeos-base/autotest | 97 chromeos-base/autotest ${EMERGE_JOBS} |
| OLD | NEW |