From 8c13d25cc3fa4e216f63f7099efbcc773be7b68a Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 13 Nov 2020 12:19:10 -0800 Subject: [PATCH] Don't try to add the generated testcase to the list of possible test files if it already exists Fixes #975 Signed-off-by: Jesse Vincent --- testing/makefiles/testcase.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/testing/makefiles/testcase.mk b/testing/makefiles/testcase.mk index b8673aa6..1492230f 100644 --- a/testing/makefiles/testcase.mk +++ b/testing/makefiles/testcase.mk @@ -14,10 +14,16 @@ LIB_FILE=${BIN_FILE}-latest.a TEST_FILES=$(wildcard $(SRC_DIR)/*.cpp) -# If we have a ktest file, we want to turn it into a generated testcase +# If we have a ktest file and no generated testcase, +# we want to turn it into a generated testcase +# and add it to the list of possible test files + ifneq (,$(wildcard test.ktest)) +ifeq (,$(findstring $(SRC_DIR)/generated-testcase.cpp, $(TEST_FILES))) TEST_FILES += $(SRC_DIR)/generated-testcase.cpp endif +endif + TEST_OBJS=$(patsubst $(SRC_DIR)/%.cpp,${OBJ_DIR}/%.o,$(TEST_FILES))