From e1d51bd99df27262bd0ac0a90aa9b7731052516f Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 20 Jan 2021 19:47:23 +0100 Subject: [PATCH] Depend on all test headers when building tests There were explicit dependencies on header files for some test suites, dating back from when only a few test suites depended on anything in tests/include. The noted dependencies were still correct, but now that tests/include is more populated, they were only the tip of the iceberg. Just keep it simple and depend on all the headers. Signed-off-by: Gilles Peskine --- tests/Makefile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index b9c55257b..719631034 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -84,7 +84,7 @@ MBEDTLS_TEST_OBJS=$(patsubst %.c,%.o,$(wildcard src/*.c src/drivers/*.c)) mbedtls_test: $(MBEDTLS_TEST_OBJS) -TEST_OBJS_DEPS = +TEST_OBJS_DEPS = $(wildcard include/test/*.h include/test/*/*.h) ifdef RECORD_PSA_STATUS_COVERAGE_LOG TEST_OBJS_DEPS += include/test/instrument_record_status.h endif @@ -130,12 +130,6 @@ $(BINARIES): %$(EXEXT): %.c $(MBEDLIBS) $(TEST_OBJS_DEPS) $(MBEDTLS_TEST_OBJS) echo " CC $<" $(CC) $(LOCAL_CFLAGS) $(CFLAGS) $< $(MBEDTLS_TEST_OBJS) $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ -# Some test suites require additional header files. -$(filter test_suite_psa_crypto%, $(BINARIES)): include/test/psa_crypto_helpers.h -$(addprefix embedded_,$(filter test_suite_psa_crypto%, $(APPS))): embedded_%: TESTS/mbedtls/%/psa_crypto_helpers.h -$(filter test_suite_psa_%, $(BINARIES)): include/test/psa_helpers.h -$(addprefix embedded_,$(filter test_suite_psa_%, $(APPS))): embedded_%: TESTS/mbedtls/%/psa_helpers.h - clean: ifndef WINDOWS rm -rf $(BINARIES) *.c *.datax TESTS @@ -192,6 +186,7 @@ endif endef $(foreach app, $(APPS), $(foreach file, $(notdir $(wildcard include/test/*.h)), \ $(eval $(call copy_header_to_target,$(app),$(file))))) +$(addprefix embedded_,$(filter test_suite_psa_%, $(APPS))): embedded_%: $(patsubst TESTS/mbedtls/%, include/test/%, $(wildcard include/test/*. include/test/*/*.h)) ifdef RECORD_PSA_STATUS_COVERAGE_LOG include/test/instrument_record_status.h: ../include/psa/crypto.h Makefile