]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
run the tests in one process
authorAlan T. DeKok <aland@freeradius.org>
Sun, 11 Jan 2026 18:40:22 +0000 (13:40 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 11 Jan 2026 18:40:22 +0000 (13:40 -0500)
which takes the run time from ~12s on my Mac down to less than 1s

src/tests/unit/all.mk

index fbb8dc3ef3e7a080a990e4bf7692155394094677..3402b6a459a5a84f3c7b5eed4f95e78ecfa0b9cb 100644 (file)
@@ -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.
 #