summaryrefslogtreecommitdiff
path: root/tests/common.sh
diff options
context:
space:
mode:
authorvbendeb <vbendeb@chromium.org>2010-06-14 15:41:27 -0700
committervbendeb <vbendeb@chromium.org>2010-06-14 15:41:27 -0700
commit70e9509a2748c0ee8646d77f2a0e6fcbb1446505 (patch)
tree3557b5823bc2200dea45d399f72af51d7cde69f8 /tests/common.sh
parent83c88cfa6920711b8a7823e1e3fc0efe8b71a04c (diff)
downloadvboot-70e9509a2748c0ee8646d77f2a0e6fcbb1446505.tar.gz
Rework the vboot_reference make system.
After this change the generated files are placed in a separate tree (such thet they don't show in the `git status' output anymore) and the dependencies are followed properly (if a .h file changes the appropriate .o files and apps get rebuilt). Tested as follows: > $ make clean > $ make # build succeeds > $ git status # shows clean directory > $ RUNTESTS=1 make # (captured test output matches that of the test run before any changes) > $ touch ./vboot_firmware/include/tlcl.h > $ make # make succeeds > $ find build -type f -newer ./vboot_firmware/include/tlcl.h build/vboot_firmware/lib/rollback_index.o build/vboot_firmware/lib/rollback_index.o.d build/vboot_firmware/a.out build/vboot_fw.a build/utility/vbutil_key build/utility/kernel_utility.d build/utility/vbutil_key.d build/utility/verify_data build/utility/load_kernel_test.d build/utility/vbutil_keyblock.d build/utility/vbutil_kernel build/utility/vbutil_kernel.d build/utility/firmware_utility build/utility/signature_digest_utility.d build/utility/kernel_utility build/utility/verify_data.d build/utility/vbutil_keyblock build/utility/signature_digest_utility build/utility/load_kernel_test build/utility/firmware_utility.d build/tests/vboot_common3_tests build/tests/vboot_common2_tests build/host/a.out $ > Review URL: http://codereview.chromium.org/2845001
Diffstat (limited to 'tests/common.sh')
-rwxr-xr-xtests/common.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/common.sh b/tests/common.sh
index 6afcd776..1e2ca03f 100755
--- a/tests/common.sh
+++ b/tests/common.sh
@@ -5,7 +5,7 @@
# found in the LICENSE file.
# Determine script directory.
-if [[ $0 == '/'* ]];
+if [[ $0 == '/'* ]];
then
SCRIPT_DIR="`dirname $0`"
elif [[ $0 == './'* ]];
@@ -15,10 +15,17 @@ else
SCRIPT_DIR="`pwd`"/"`dirname $0`"
fi
-UTIL_DIR=`dirname ${SCRIPT_DIR}`/utility
-TEST_DIR=${SCRIPT_DIR}
+ROOT_DIR="$(dirname ${SCRIPT_DIR})"
+BUILD_DIR="${ROOT_DIR}/build"
+UTIL_DIR="${BUILD_DIR}/utility"
+TEST_DIR="${BUILD_DIR}/tests"
TESTKEY_DIR=${SCRIPT_DIR}/testkeys
TESTCASE_DIR=${SCRIPT_DIR}/testcases
+TESTKEY_SCRATCH_DIR=${TEST_DIR}/testkeys
+
+if [ ! -d ${TESTKEY_SCRATCH_DIR} ]; then
+ mkdir ${TESTKEY_SCRATCH_DIR}
+fi
# Color output encodings.
COL_RED='\E[31;1m'