OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 # | 5 # |
6 # Packages up tests for that they can run outside of the build tree. | 6 # Packages up tests for that they can run outside of the build tree. |
7 | 7 |
8 # Load common constants. This should be the first executable line. | 8 # Load common constants. This should be the first executable line. |
9 # The path to common.sh should be relative to your script's location. | 9 # The path to common.sh should be relative to your script's location. |
10 COMMON_SH="$(dirname "$0")/../../scripts/common.sh" | 10 COMMON_SH="$(dirname "$0")/../../scripts/common.sh" |
11 . "$COMMON_SH" | 11 . "$COMMON_SH" |
12 | 12 |
13 | |
14 OUT_DIR=${DEFAULT_BUILD_ROOT}/x86/tests | |
15 mkdir -p ${OUT_DIR} | 13 mkdir -p ${OUT_DIR} |
16 TARGET=${OUT_DIR}/cryptohome_tests | 14 TARGET=${OUT_DIR}/cryptohome_tests |
17 | 15 |
18 # package_tests target runfile | 16 # package_tests target runfile |
19 function package_tests() { | 17 function package_tests() { |
20 local package="$1" | 18 local package="$1" |
21 local testfile="$2" | 19 local testfile="$2" |
22 shift; shift | 20 shift; shift |
23 local libs="$@" | 21 local libs="$@" |
24 TMPDIR="${TMPDIR:-/tmp}" | 22 TMPDIR="${TMPDIR:-/tmp}" |
(...skipping 30 matching lines...) Expand all Loading... |
55 cp -r "$source/tests" tests | 53 cp -r "$source/tests" tests |
56 cp -a "$source/$testfile" $testfile | 54 cp -a "$source/$testfile" $testfile |
57 tar --exclude=".svn" --exclude=".git" -czf - * >> $package | 55 tar --exclude=".svn" --exclude=".git" -czf - * >> $package |
58 popd &> /dev/null | 56 popd &> /dev/null |
59 trap - ERR | 57 trap - ERR |
60 cleanup | 58 cleanup |
61 chmod +x $package | 59 chmod +x $package |
62 } | 60 } |
63 | 61 |
64 package_tests "$TARGET" test.sh | 62 package_tests "$TARGET" test.sh |
OLD | NEW |