summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deymo <deymo@chromium.org>2014-08-27 20:48:29 -0700
committerAlex Deymo <deymo@chromium.org>2014-08-28 16:21:47 +0000
commitb77aff570216cf1a58d687bde1512d88edba519f (patch)
treee4545773f7e45f9256be333aaa1c29a4a6266a8c
parenta2d72f70c18905aba25eb0971f6f601dd1fa5a60 (diff)
downloadvboot-b77aff570216cf1a58d687bde1512d88edba519f.tar.gz
Development script for testing changes locally.
Several ebuilds depend on vboot_reference, either by checking out the vboot_reference repo and building it or by using the installed libs during build time. To simplify catching problems in other ebuilds while changing code in vboot_reference, this patch adds a new script that tries to emerge all the affected ebuilds. BUG=None BRANCH=None TEST=`../platform/vboot_reference/emerge_test.sh` inside and outside the chroot Change-Id: I0e9e61c35cbb191e0dafa5f8fa1e74d80bb7f8d4 Reviewed-on: https://chromium-review.googlesource.com/214635 Tested-by: Alex Deymo <deymo@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rwxr-xr-xemerge_test.sh59
1 files changed, 59 insertions, 0 deletions
diff --git a/emerge_test.sh b/emerge_test.sh
new file mode 100755
index 00000000..cbe51444
--- /dev/null
+++ b/emerge_test.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+# Copyright 2014 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Tests emerging all the ebuilds that use vboot_reference either as an
+# ebuild dependency or by checking out the code and compiling it in a
+# different ebuild. This is meant to be run from the chroot as part of testing
+# a new change in vboot_reference.
+
+# Required ebuilds:
+TEST_EBUILDS="
+ sys-boot/chromeos-bootimage
+ sys-boot/coreboot
+ sys-boot/depthcharge
+ chromeos-base/chromeos-cryptohome
+ chromeos-base/chromeos-ec
+ chromeos-base/chromeos-installer
+ chromeos-base/chromeos-initramfs
+ chromeos-base/chromeos-login
+ chromeos-base/update_engine
+ chromeos-base/vboot_reference
+ chromeos-base/verity
+"
+
+set -e
+
+# Check running inside the chroot.
+if [ ! -e /etc/cros_chroot_version ]; then
+ echo "You must run this inside the chroot." >&2
+ exit 1
+fi
+
+# Detect the target board.
+if [ "x${BOARD}" == "x" ]; then
+ if [ -e ~/trunk/src/scripts/.default_board ]; then
+ BOARD="`cat ~/trunk/src/scripts/.default_board`"
+ else
+ echo "You must pass BOARD environment variable or set a default board." >&2
+ exit 1
+ fi
+fi
+
+VBOOT_REF_DIR="$(dirname "$0")"
+echo "Running tests for board '${BOARD}' from ${VBOOT_REF_DIR}"
+
+cd "${VBOOT_REF_DIR}"
+
+echo "Running make runtests..."
+make runtests -j32
+
+echo "Removing build artifacts."
+rm -rf build build-main
+
+echo "Running emerge tests (runs cros_workon start)."
+# Ignore errors about already working on those repos.
+cros_workon-${BOARD} start ${TEST_EBUILDS} || true
+
+USE=depthcharge emerge-${BOARD} ${TEST_EBUILDS}