From b10d283d34ca12cae1301b8b3ddd500c2965d9f0 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Sun, 11 Jan 2026 13:40:22 -0500 Subject: [PATCH] run the tests in one process which takes the run time from ~12s on my Mac down to less than 1s --- src/tests/unit/all.mk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/tests/unit/all.mk b/src/tests/unit/all.mk index fbb8dc3ef3e..3402b6a459a 100644 --- a/src/tests/unit/all.mk +++ b/src/tests/unit/all.mk @@ -24,6 +24,9 @@ endif # FILES := $(subst $(DIR)/,,$(FILES)) +FILES_PURIFY := $(filter purify/%,$(FILES)) +FILES_NORMAL := $(filter-out purify/%,$(FILES)) + # dict.txt - removed because the unit tests don't allow for protocol namespaces # command.txt - removed because commands like ":sql" are not parsed properly any more @@ -84,6 +87,16 @@ $(filter $(BUILD_DIR)/tests/unit/purify/%,$(FILES.$(TEST))): PURIFY=-p # #REWRITE_FLAGS = -w $(BUILD_DIR)/tmp +$(addprefix $(OUTPUT)/,$(FILES_NORMAL)) &: $(addprefix src/tests/unit/,$(FILES_NORMAL)) + $(eval DIR:=${top_srcdir}/src/tests/unit) + $(eval export UNIT_TEST_ATTRIBUTE:=TZ=GMT $(TEST_BIN_NO_TIMEOUT)/unit_test_attribute $(PURIFY) -F ./src/tests/fuzzer-corpus -D ./share/dictionary -d $(DIR) -r build/tests/unit/) + ${Q}$(TEST_BIN)/unit_test_attribute $(REWRITE_FLAGS) -F ./src/tests/fuzzer-corpus -D ./share/dictionary -d $(DIR) -r build/tests/unit/ $(filter src/tests/unit/%,$?) + +$(addprefix $(OUTPUT)/,$(FILES_PURIFY)) &: $(addprefix src/tests/unit/,$(FILES_PURIFY)) + $(eval DIR:=${top_srcdir}/src/tests/unit) + $(eval export UNIT_TEST_ATTRIBUTE:=TZ=GMT $(TEST_BIN_NO_TIMEOUT)/unit_test_attribute $(PURIFY) -F ./src/tests/fuzzer-corpus -D ./share/dictionary -d $(DIR) -p -r build/tests/unit/) + ${Q}$(TEST_BIN)/unit_test_attribute $(REWRITE_FLAGS) -p -F ./src/tests/fuzzer-corpus -D ./share/dictionary -d $(DIR) -r build/tests/unit/ $(filter src/tests/unit/%,$?) + # # And the actual script to run each test. # -- 2.47.3