blob: cbe514442bfd52d73838f8d1df52f3d44c0b158d [file] [log] [blame]
Alex Deymob77aff52014-08-27 20:48:29 -07001#!/bin/sh
2# Copyright 2014 The Chromium OS Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6# Tests emerging all the ebuilds that use vboot_reference either as an
7# ebuild dependency or by checking out the code and compiling it in a
8# different ebuild. This is meant to be run from the chroot as part of testing
9# a new change in vboot_reference.
10
11# Required ebuilds:
12TEST_EBUILDS="
13 sys-boot/chromeos-bootimage
14 sys-boot/coreboot
15 sys-boot/depthcharge
16 chromeos-base/chromeos-cryptohome
17 chromeos-base/chromeos-ec
18 chromeos-base/chromeos-installer
19 chromeos-base/chromeos-initramfs
20 chromeos-base/chromeos-login
21 chromeos-base/update_engine
22 chromeos-base/vboot_reference
23 chromeos-base/verity
24"
25
26set -e
27
28# Check running inside the chroot.
29if [ ! -e /etc/cros_chroot_version ]; then
30 echo "You must run this inside the chroot." >&2
31 exit 1
32fi
33
34# Detect the target board.
35if [ "x${BOARD}" == "x" ]; then
36 if [ -e ~/trunk/src/scripts/.default_board ]; then
37 BOARD="`cat ~/trunk/src/scripts/.default_board`"
38 else
39 echo "You must pass BOARD environment variable or set a default board." >&2
40 exit 1
41 fi
42fi
43
44VBOOT_REF_DIR="$(dirname "$0")"
45echo "Running tests for board '${BOARD}' from ${VBOOT_REF_DIR}"
46
47cd "${VBOOT_REF_DIR}"
48
49echo "Running make runtests..."
50make runtests -j32
51
52echo "Removing build artifacts."
53rm -rf build build-main
54
55echo "Running emerge tests (runs cros_workon start)."
56# Ignore errors about already working on those repos.
57cros_workon-${BOARD} start ${TEST_EBUILDS} || true
58
59USE=depthcharge emerge-${BOARD} ${TEST_EBUILDS}