diff options
author | Chung-yih Wang <cywang@chromium.org> | 2012-11-21 15:18:48 +0800 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-11-21 19:27:34 -0800 |
commit | 482ea8ee02812bf74a2e4aec7bc1474692c30437 (patch) | |
tree | eaf788d601597dccaa72c97d5342ae08d679d06b /tools | |
parent | a6eb7c8d290dbbed7a6ea72eabede3734af417a7 (diff) | |
download | libchrome-gestures-482ea8ee02812bf74a2e4aec7bc1474692c30437.tar.gz |
Add libevdev version check in regression test script
BUG=chromium-os:36545
TEST=run the following steps and check if the libevdev.so is
checked and updated if necessary under chroot
$ cd ~/trunk/src/platform/gestures
$ tools/regression_test.sh
Check if we could see something similar in the output of the script
INFO : Check chroot libevdev.so version 1359d8be1e73ae1fbffa079b39e627d76cca4f7e...
Change-Id: I9a34cccf92fd72929f484202f319cd3fccb05083
Reviewed-on: https://gerrit.chromium.org/gerrit/38453
Reviewed-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Ready: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/regression_test.sh | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/tools/regression_test.sh b/tools/regression_test.sh index be2abad..47e0c3a 100755 --- a/tools/regression_test.sh +++ b/tools/regression_test.sh @@ -8,17 +8,22 @@ # regression for each submit. # Set current directory to the project one and load the common script. +pushd . >/dev/null cd "$(dirname "$(readlink -f "$0")")/.." . "../../scripts/common.sh" || exit 1 -update_chroot_libgestures() { - info "Check chroot libgestures version ${commit_head_hash}..." +update_chroot_library() { + library=$1 + version=$2 + project=$3 + info "Check chroot $library version ${version}..." - if ! grep -q ${commit_head_hash} /usr/lib/libgestures.so; then - info "Update the gestures library under chroot.." - sudo emerge -q gestures - if ! grep -q ${commit_head_hash} /usr/lib/libgestures.so; then - die_notrace "Can not install libgestures successfully" + if ! grep -q ${version} /usr/lib/${library} ; then + info "Update the library ${library} under chroot.." + sudo emerge -q ${project} + info grep ${version} /usr/lib/${library} + if ! grep -q ${version} /usr/lib/${library} ; then + die_notrace "Can not install ${library} successfully" fi fi } @@ -45,18 +50,22 @@ check_test_setup() { if [[ ! -e /usr/lib/libgestures.so ]]; then install_regression_test_suite else - update_chroot_libgestures + update_chroot_library libgestures.so ${libgestures_head_hash} gestures + update_chroot_library libevdev.so ${libevdev_head_hash} libevdev fi } -commit_head_hash=`git rev-parse HEAD` +libevdev_head_hash=`cd ../libevdev; git rev-parse HEAD` +libgestures_head_hash=`git rev-parse HEAD` if [[ ${INSIDE_CHROOT} -ne 1 ]]; then - if [[ "${PRESUBMIT_COMMIT}" == "${commit_head_hash}" ]]; then + if [[ "${PRESUBMIT_COMMIT}" == "${libgestures_head_hash}" ]]; then + popd >/dev/null restart_in_chroot_if_needed "$@" fi else - cros_workon --host start gestures + cros_workon --host start gestures libevdev check_test_setup run_regression_tests + popd >/dev/null fi exit 0 |