From 95589b9aca35e53c4ad064cc0b41c87aaf0b3a68 Mon Sep 17 00:00:00 2001 From: Taylor Yu Date: Sun, 10 Dec 2023 12:59:10 -0600 Subject: [PATCH] testing: avoid duplicate filenames Use immediate assignment to avoid duplicate object filenames when initially generating testcase files. This was causing linker errors on macOS, but only on the first build attempt. Signed-off-by: Taylor Yu --- testing/makefiles/testcase.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testing/makefiles/testcase.mk b/testing/makefiles/testcase.mk index 5bf4e46e30..3f466d68f2 100644 --- a/testing/makefiles/testcase.mk +++ b/testing/makefiles/testcase.mk @@ -47,7 +47,8 @@ SKETCH_FILE=$(wildcard *.ino) BIN_FILE=$(subst .ino,,$(SKETCH_FILE)) LIB_FILE=${BIN_FILE}-latest.a -TEST_FILES=$(sort $(wildcard $(SRC_DIR)/*.cpp)) +# Immediate assignment prevents duplicates after append from HAS_KTEST_FILE +TEST_FILES:=$(sort $(wildcard $(SRC_DIR)/*.cpp)) # If we have a ktest file and no generated testcase, # we want to turn it into a generated testcase