Chromium Code Reviews| 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 # |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 | 30 |
| 31 # parse the command-line | 31 # parse the command-line |
| 32 FLAGS "$@" || exit 1 | 32 FLAGS "$@" || exit 1 |
| 33 eval set -- "${FLAGS_ARGV}" | 33 eval set -- "${FLAGS_ARGV}" |
| 34 set -e | 34 set -e |
| 35 | 35 |
| 36 check_board | 36 check_board |
| 37 | 37 |
| 38 # build default pre-compile client tests list. | 38 # build default pre-compile client tests list. |
| 39 ALL_TESTS="compilebench,dbench,disktest,ltp,netperf2,unixbench" | 39 ALL_TESTS="compilebench,dbench,disktest,ltp,netperf2,unixbench" |
| 40 for SITE_TEST in ../third_party/autotest/files/client/site_tests/* | 40 CLIENT_TEST_PATH="../third_party/autotest/files/client/site_tests" |
| 41 for SITE_TEST in ${CLIENT_TEST_PATH}/* | |
| 41 do | 42 do |
| 42 if [ -d ${SITE_TEST} ] | 43 if [ -d ${SITE_TEST} ] |
| 43 then | 44 then |
| 44 ALL_TESTS="${ALL_TESTS},${SITE_TEST:48}" | 45 ALL_TESTS="${ALL_TESTS},${SITE_TEST##${CLIENT_TEST_PATH}/}" |
| 45 fi | 46 fi |
| 46 done | 47 done |
| 47 | 48 |
| 49 # Load the overlay specific blacklist and remove any matching tests. | |
| 50 PRIMARY_BOARD_OVERLAY="${SRC_ROOT}/overlays/overlay-${FLAGS_board}" | |
| 51 BLACKLIST_FILE="${PRIMARY_BOARD_OVERLAY}/autotest-blacklist" | |
| 52 if [ -r "${BLACKLIST_FILE}" ] | |
| 53 then | |
| 54 BLACKLISTED_TESTS=$(cat ${BLACKLIST_FILE}) | |
| 55 | |
| 56 for TEST in ${BLACKLISTED_TESTS} | |
|
petkov
2010/03/17 17:27:49
Another way to do this, not necessarily better or
| |
| 57 do | |
| 58 ALL_TESTS=${ALL_TESTS/#${TEST},/} # match first test (test,...) | |
| 59 ALL_TESTS=${ALL_TESTS/,${TEST},/,} # match middle tests (...,test,...) | |
| 60 ALL_TESTS=${ALL_TESTS/%,${TEST}/} # match last test (...,test) | |
| 61 done | |
| 62 fi | |
| 63 | |
| 48 if [ ${FLAGS_build} == ${DEFAULT_TESTS_LIST} ] | 64 if [ ${FLAGS_build} == ${DEFAULT_TESTS_LIST} ] |
| 49 then | 65 then |
| 50 if [ ${FLAGS_prompt} -eq ${FLAGS_TRUE} ] | 66 if [ ${FLAGS_prompt} -eq ${FLAGS_TRUE} ] |
| 51 then | 67 then |
| 52 echo -n "You want to pre-build all client tests and it may take a long time" | 68 echo -n "You want to pre-build all client tests and it may take a long time" |
| 53 echo " to finish. " | 69 echo " to finish. " |
| 54 read -p "Are you sure you want to continue?(N/y)" answer | 70 read -p "Are you sure you want to continue?(N/y)" answer |
| 55 answer=${answer:0:1} | 71 answer=${answer:0:1} |
| 56 if [ "${answer}" != "Y" ] && [ "${answer}" != "y" ] | 72 if [ "${answer}" != "Y" ] && [ "${answer}" != "y" ] |
| 57 then | 73 then |
| 58 echo "Use --build to specify tests you like to pre-compile." | 74 echo "Use --build to specify tests you like to pre-compile." |
| 59 echo -n "E.g.: ./enter_chroot.sh \"./build_autotest.sh " | 75 echo -n "E.g.: ./enter_chroot.sh \"./build_autotest.sh " |
| 60 echo "--build=system_SAT\"" | 76 echo "--build=system_SAT\"" |
| 61 exit 0 | 77 exit 0 |
| 62 fi | 78 fi |
| 63 fi | 79 fi |
| 64 TEST_LIST=${ALL_TESTS} | 80 TEST_LIST=${ALL_TESTS} |
| 65 else | 81 else |
| 66 TEST_LIST=${FLAGS_build} | 82 TEST_LIST=${FLAGS_build} |
| 67 fi | 83 fi |
| 68 | 84 |
| 69 # Decide on USE flags based on options | 85 # Decide on USE flags based on options |
| 70 USE= | 86 USE= |
| 71 [ $FLAGS_autox -eq "$FLAGS_FALSE" ] && USE="${USE} -autox" | 87 [ $FLAGS_autox -eq "$FLAGS_FALSE" ] && USE="${USE} -autox" |
| 72 [ $FLAGS_buildcheck -eq "$FLAGS_TRUE" ] && USE="${USE} buildcheck" | 88 [ $FLAGS_buildcheck -eq "$FLAGS_TRUE" ] && USE="${USE} buildcheck" |
| 73 | 89 |
| 74 GCLIENT_ROOT="${GCLIENT_ROOT}" TEST_LIST=${TEST_LIST} \ | 90 GCLIENT_ROOT="${GCLIENT_ROOT}" TEST_LIST=${TEST_LIST} \ |
| 75 FEATURES="${FEATURES} -buildpkg" USE="$USE" "emerge-${FLAGS_board}" \ | 91 FEATURES="${FEATURES} -buildpkg" USE="$USE" "emerge-${FLAGS_board}" \ |
| 76 chromeos-base/autotest | 92 chromeos-base/autotest |
| OLD | NEW |