summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile33
1 files changed, 24 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 82d6a44a..9e41123d 100644
--- a/Makefile
+++ b/Makefile
@@ -56,6 +56,7 @@ DEV_DEBUG_FORCE=
# US_DIR = shared data directory (for static content like devkeys)
# DF_DIR = utility defaults directory
# VB_DIR = vboot binary directory for dev-mode-only scripts
+# DUT_TEST_DIR = vboot dut tests binary directory
UB_DIR=${DESTDIR}/usr/bin
UL_DIR=${DESTDIR}/usr/${LIBDIR}
ULP_DIR=${UL_DIR}/pkgconfig
@@ -63,6 +64,7 @@ UI_DIR=${DESTDIR}/usr/include/vboot
US_DIR=${DESTDIR}/usr/share/vboot
DF_DIR=${DESTDIR}/etc/default
VB_DIR=${US_DIR}/bin
+DUT_TEST_DIR=${US_DIR}/tests
# Where to install the (exportable) executables for testing?
TEST_INSTALL_DIR = ${BUILD}/install_for_test
@@ -768,10 +770,12 @@ TEST21_NAMES = \
TEST_NAMES += ${TEST2X_NAMES} ${TEST20_NAMES} ${TEST21_NAMES}
-# This is build-only test since we can't run this without
-# sha-ni extension on x86. To run this test, you have to
-# manually copy executable into compatible machine and run it.
-TEST_NAMES += tests/vb2_sha256_x86_tests
+# Tests which should be run on dut
+ifeq (${ARCH}, x86_64)
+DUT_TEST_NAMES += tests/vb2_sha256_x86_tests
+endif
+
+TEST_NAMES += ${DUT_TEST_NAMES}
# And a few more...
ifeq (${TPM2_MODE},)
@@ -1094,17 +1098,28 @@ ${TEST20_BINS}: ${FWLIB}
${TEST20_BINS}: LIBS += ${FWLIB}
${TEST20_BINS}: LDLIBS += ${CRYPTO_LIBS}
-# Special build for sha256_x86 test
-X86_SHA256_TEST = ${BUILD_RUN}/tests/vb2_sha256_x86_tests
-${X86_SHA256_TEST}: ${BUILD}/firmware/2lib/2sha256_x86.o
-${X86_SHA256_TEST}: LIBS += ${BUILD}/firmware/2lib/2sha256_x86.o
-
${TESTLIB}: ${TESTLIB_OBJS}
@${PRINTF} " RM $(subst ${BUILD}/,,$@)\n"
${Q}rm -f $@
@${PRINTF} " AR $(subst ${BUILD}/,,$@)\n"
${Q}ar qc $@ $^
+DUT_TEST_BINS = $(addprefix ${BUILD}/,${DUT_TEST_NAMES})
+
+# Special build for sha256_x86 test
+${BUILD}/tests/vb2_sha256_x86_tests: \
+ ${BUILD}/firmware/2lib/2sha256_x86.o
+${BUILD}/tests/vb2_sha256_x86_tests: \
+ LIBS += ${BUILD}/firmware/2lib/2sha256_x86.o
+
+.PHONY: install_dut_test
+install_dut_test: ${DUT_TEST_BINS}
+ifneq ($(strip ${DUT_TEST_BINS}),)
+ @${PRINTF} " INSTALL DUT TESTS\n"
+ ${Q}mkdir -p ${DUT_TEST_DIR}
+ ${Q}${INSTALL} -t ${DUT_TEST_DIR} $^
+endif
+
# ----------------------------------------------------------------------------
# Fuzzers