Home | History | Annotate | Download | only in vboot_reference
      1 #!/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:
     12 TEST_EBUILDS="
     13   sys-boot/chromeos-bootimage
     14   sys-boot/chromeos-u-boot
     15   sys-boot/coreboot
     16   sys-boot/depthcharge
     17   chromeos-base/chromeos-cryptohome
     18   chromeos-base/chromeos-ec
     19   chromeos-base/chromeos-installer
     20   chromeos-base/chromeos-initramfs
     21   chromeos-base/chromeos-login
     22   chromeos-base/update_engine
     23   chromeos-base/vboot_reference
     24   chromeos-base/verity
     25 "
     26 
     27 set -e
     28 
     29 # Check running inside the chroot.
     30 if [ ! -e /etc/cros_chroot_version ]; then
     31   echo "You must run this inside the chroot." >&2
     32   exit 1
     33 fi
     34 
     35 # Detect the target board.
     36 if [ "x${BOARD}" == "x" ]; then
     37   if [ -e ~/trunk/src/scripts/.default_board ]; then
     38     BOARD="`cat ~/trunk/src/scripts/.default_board`"
     39   else
     40     echo "You must pass BOARD environment variable or set a default board." >&2
     41     exit 1
     42   fi
     43 fi
     44 
     45 VBOOT_REF_DIR="$(dirname "$0")"
     46 echo "Running tests for board '${BOARD}' from ${VBOOT_REF_DIR}"
     47 
     48 cd "${VBOOT_REF_DIR}"
     49 
     50 echo "Running make runtests..."
     51 make runtests -j32
     52 
     53 echo "Removing build artifacts."
     54 rm -rf build build-main
     55 
     56 echo "Running emerge tests (runs cros_workon start)."
     57 # Ignore errors about already working on those repos.
     58 cros_workon-${BOARD} start ${TEST_EBUILDS} || true
     59 
     60 USE=depthcharge emerge-${BOARD} ${TEST_EBUILDS}
     61