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 # Flags | 11 # Flags |
12 DEFINE_string build_root "$DEFAULT_BUILD_ROOT" \ | 12 DEFINE_string build_root "$DEFAULT_BUILD_ROOT" \ |
13 "Root of build output" | 13 "Root of build output" |
| 14 DEFINE_string board "" \ |
| 15 "Target board of which tests were built" |
14 | 16 |
15 # Parse command line | 17 # Parse command line |
16 FLAGS "$@" || exit 1 | 18 FLAGS "$@" || exit 1 |
17 eval set -- "${FLAGS_ARGV}" | 19 eval set -- "${FLAGS_ARGV}" |
18 | 20 |
19 # Die on error; print commands | 21 # Die on error; print commands |
20 set -ex | 22 set -ex |
21 | 23 |
22 # Run tests | 24 # Run tests |
23 TESTS_DIR="$FLAGS_build_root/x86/tests" | 25 if [ -n "$FLAGS_board" ] |
24 cd "$TESTS_DIR" | 26 then |
25 | 27 TESTS_DIR="/build/${FLAGS_board}/tests" |
26 # TODO: standardize test names - should all end in "_test" | 28 echo "Not implemented" >&2 |
27 for i in *_test *_tests *_unittests; do ./${i}; done | 29 exit 1 |
28 | 30 |
29 cd - | 31 # TODO(sosa@chromium.org) - Call autotest job to run tests from TESTS_DIR |
30 echo "All tests passed." | 32 # using run_remote_tests |
| 33 else |
| 34 TESTS_DIR="$FLAGS_build_root/x86/tests" |
| 35 cd "$TESTS_DIR" |
| 36 |
| 37 # TODO: standardize test names - should all end in "_test" |
| 38 for i in *_test *_tests *_unittests; do ! ./${i}; done |
| 39 |
| 40 cd - |
| 41 echo "All tests passed." |
| 42 fi |
OLD | NEW |