emerge_test.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. # Tests emerging all the ebuilds that use vboot_reference either as an
  6. # ebuild dependency or by checking out the code and compiling it in a
  7. # different ebuild. This is meant to be run from the chroot as part of testing
  8. # a new change in vboot_reference.
  9. # Required ebuilds:
  10. TEST_EBUILDS="
  11. sys-boot/chromeos-bootimage
  12. sys-boot/chromeos-u-boot
  13. sys-boot/coreboot
  14. sys-boot/depthcharge
  15. chromeos-base/chromeos-cryptohome
  16. chromeos-base/chromeos-ec
  17. chromeos-base/chromeos-installer
  18. chromeos-base/chromeos-initramfs
  19. chromeos-base/chromeos-login
  20. chromeos-base/update_engine
  21. chromeos-base/vboot_reference
  22. chromeos-base/verity
  23. "
  24. set -e
  25. # Check running inside the chroot.
  26. if [ ! -e /etc/cros_chroot_version ]; then
  27. echo "You must run this inside the chroot." >&2
  28. exit 1
  29. fi
  30. # Detect the target board.
  31. if [ "x${BOARD}" == "x" ]; then
  32. if [ -e ~/trunk/src/scripts/.default_board ]; then
  33. BOARD="`cat ~/trunk/src/scripts/.default_board`"
  34. else
  35. echo "You must pass BOARD environment variable or set a default board." >&2
  36. exit 1
  37. fi
  38. fi
  39. VBOOT_REF_DIR="$(dirname "$0")"
  40. echo "Running tests for board '${BOARD}' from ${VBOOT_REF_DIR}"
  41. cd "${VBOOT_REF_DIR}"
  42. echo "Running make runtests..."
  43. make runtests -j32
  44. echo "Removing build artifacts."
  45. rm -rf build build-main
  46. echo "Running emerge tests (runs cros_workon start)."
  47. # Ignore errors about already working on those repos.
  48. cros_workon-${BOARD} start ${TEST_EBUILDS} || true
  49. emerge-${BOARD} ${TEST_EBUILDS}