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_FALSE "Fail if tests fail to build" |
26 | 27 |
27 # More useful help | 28 # More useful help |
28 FLAGS_HELP="usage: $0 [flags]" | 29 FLAGS_HELP="usage: $0 [flags]" |
29 | 30 |
30 # parse the command-line | 31 # parse the command-line |
31 FLAGS "$@" || exit 1 | 32 FLAGS "$@" || exit 1 |
32 eval set -- "${FLAGS_ARGV}" | 33 eval set -- "${FLAGS_ARGV}" |
33 set -e | 34 set -e |
34 | 35 |
35 check_board | 36 check_board |
(...skipping 22 matching lines...) Expand all Loading... |
58 echo -n "E.g.: ./enter_chroot.sh \"./build_autotest.sh " | 59 echo -n "E.g.: ./enter_chroot.sh \"./build_autotest.sh " |
59 echo "--build=system_SAT\"" | 60 echo "--build=system_SAT\"" |
60 exit 0 | 61 exit 0 |
61 fi | 62 fi |
62 fi | 63 fi |
63 TEST_LIST=${ALL_TESTS} | 64 TEST_LIST=${ALL_TESTS} |
64 else | 65 else |
65 TEST_LIST=${FLAGS_build} | 66 TEST_LIST=${FLAGS_build} |
66 fi | 67 fi |
67 | 68 |
68 # Decide whether or not to build autox and set use flag | 69 # Decide on USE flags based on options |
69 if [ $FLAGS_autox -eq "$FLAGS_TRUE" ] ; then | 70 USE= |
70 USE= | 71 [ $FLAGS_autox -eq "$FLAGS_FALSE" ] && USE="${USE} -autox" |
71 else | 72 [ $FLAGS_buildcheck -eq "$FLAGS_TRUE" ] && USE="${USE} buildcheck" |
72 USE=-autox | |
73 fi | |
74 | 73 |
75 GCLIENT_ROOT="${GCLIENT_ROOT}" TEST_LIST=${TEST_LIST} FEATURES="-buildpkg" \ | 74 GCLIENT_ROOT="${GCLIENT_ROOT}" TEST_LIST=${TEST_LIST} FEATURES="-buildpkg" \ |
76 USE="$USE" "emerge-${FLAGS_board}" chromeos-base/autotest | 75 USE="$USE" "emerge-${FLAGS_board}" chromeos-base/autotest |
OLD | NEW |