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 # Load common constants. This should be the first executable line. | 7 # Load common constants. This should be the first executable line. |
8 # The path to common.sh should be relative to your script's location. | 8 # The path to common.sh should be relative to your script's location. |
9 . "$(dirname "$0")/common.sh" | 9 . "$(dirname "$0")/common.sh" |
10 | 10 |
11 assert_inside_chroot | 11 assert_inside_chroot |
12 assert_not_root_user | 12 assert_not_root_user |
13 get_default_board | |
13 | 14 |
14 # Flags | 15 # Flags |
15 DEFINE_string build_root "$DEFAULT_BUILD_ROOT" \ | 16 DEFINE_string build_root "$DEFAULT_BUILD_ROOT" \ |
16 "Root of build output" | 17 "Root of build output" |
17 DEFINE_string board "" "Target board for which tests are to be built" | 18 DEFINE_string board "$DEFAULT_BOARD" \ |
19 "Target board for which tests are to be built" | |
18 | 20 |
19 # Parse command line | 21 # Parse command line |
20 FLAGS "$@" || exit 1 | 22 FLAGS "$@" || exit 1 |
21 eval set -- "${FLAGS_ARGV}" | 23 eval set -- "${FLAGS_ARGV}" |
22 | 24 |
25 if [ -z "$FLAGS_board" ]; then | |
kmixter1
2010/03/04 00:23:15
nit: consistent use of "${var}" style
| |
26 echo Error: --board required | |
27 exit 1 | |
28 fi | |
29 | |
23 # Die on error; print commands | 30 # Die on error; print commands |
24 set -e | 31 set -e |
25 | 32 |
26 TEST_DIRS="pam_google window_manager cryptohome" | 33 TEST_DIRS="pam_google window_manager cryptohome" |
27 | 34 |
28 if [ -n "$FLAGS_board" ] | 35 sudo TEST_DIRS="${TEST_DIRS}" \ |
29 then | 36 emerge-${FLAGS_board} chromeos-base/chromeos-unittests |
30 sudo TEST_DIRS="${TEST_DIRS}" \ | |
31 emerge-${FLAGS_board} chromeos-base/chromeos-unittests | |
32 else | |
33 PLATFORM_DIR="$SRC_ROOT/platform" | |
34 | |
35 # Build tests | |
36 for i in ${TEST_DIRS} | |
37 do | |
38 echo "building $PLATFORM_DIR/$i" | |
39 cd "$PLATFORM_DIR/$i" | |
40 OUT_DIR="${FLAGS_build_root}/x86/tests" ./make_tests.sh | |
41 cd - | |
42 done | |
43 | |
44 echo "All tests built." | |
45 fi | |
OLD | NEW |