| 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 | 13 |
| 14 # Flags | 14 # Flags |
| 15 DEFINE_string build_root "$DEFAULT_BUILD_ROOT" \ |
| 16 "Root of build output" |
| 17 DEFINE_string board "" "Target board for which tests are to be built" |
| 15 | 18 |
| 16 # Parse command line | 19 # Parse command line |
| 17 FLAGS "$@" || exit 1 | 20 FLAGS "$@" || exit 1 |
| 18 eval set -- "${FLAGS_ARGV}" | 21 eval set -- "${FLAGS_ARGV}" |
| 19 | 22 |
| 20 # Die on error; print commands | 23 # Die on error; print commands |
| 21 set -e | 24 set -e |
| 22 | 25 |
| 23 PLATFORM_DIR="$SRC_ROOT/platform" | 26 TEST_DIRS="pam_google window_manager cryptohome" |
| 24 PLATFORM_DIRS="pam_google window_manager cryptohome" | |
| 25 | 27 |
| 26 # Build tests | 28 if [ -n "$FLAGS_board" ] |
| 27 for i in $PLATFORM_DIRS | 29 then |
| 28 do | 30 sudo TEST_DIRS="${TEST_DIRS}" \ |
| 29 echo "building $PLATFORM_DIR/$i" | 31 emerge-${FLAGS_board} chromeos-base/chromeos-unittests |
| 30 cd "$PLATFORM_DIR/$i" | 32 else |
| 31 ./make_tests.sh | 33 PLATFORM_DIR="$SRC_ROOT/platform" |
| 32 cd - | 34 |
| 33 done | 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 |
| 34 | 43 |
| 35 echo "All tests built." | 44 echo "All tests built." |
| 45 fi |
| OLD | NEW |