From b83604d37eb67bc227fa236ea2ba208993b8718a Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sun, 27 Mar 2022 19:59:02 -0700 Subject: [PATCH] Fix some dependency errors in test makefile rules that could cause parallel testing to fail --- testing/makefiles/testcase.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testing/makefiles/testcase.mk b/testing/makefiles/testcase.mk index 7aef8449..1a35608e 100644 --- a/testing/makefiles/testcase.mk +++ b/testing/makefiles/testcase.mk @@ -64,7 +64,7 @@ endif TEST_OBJS=$(patsubst $(SRC_DIR)/%.cpp,${OBJ_DIR}/%.o,$(TEST_FILES)) -build: ${BIN_DIR}/${BIN_FILE} compile-sketch +build: $(if $(HAS_KTEST_FILE), generate-testcase) compile-sketch all: run @@ -72,9 +72,10 @@ run: ${BIN_DIR}/${BIN_FILE} $(info Running test $(testcase)) $(QUIET) "${BIN_DIR}/${BIN_FILE}" -t -q -${BIN_DIR}/${BIN_FILE}: ${TEST_OBJS} +${BIN_DIR}/${BIN_FILE}: compile-sketch # We force sketch recompiliation because otherwise, make won't pick up changes to...anything on the arduino side +.PHONY: compile-sketch compile-sketch: ${TEST_OBJS} @install -d "${BIN_DIR}" "${LIB_DIR}" $(QUIET) env LIBONLY=yes VERBOSE=${VERBOSE} \ @@ -91,9 +92,9 @@ compile-sketch: ${TEST_OBJS} # If we have a test.ktest file, it should be processed into a c++ testcase +.PHONY: generate-testcase generate-testcase: $(if $(HAS_KTEST_FILE), ${SRC_DIR}/generated-testcase.cpp) - ${SRC_DIR}/generated-testcase.cpp: test.ktest ifneq (,$(wildcard test.ktest)) ifdef VERBOSE