]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
tweak rules and test harness to do nothing if there's nothing to do
authorAlan T. DeKok <aland@freeradius.org>
Wed, 14 Jan 2026 18:41:28 +0000 (13:41 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 14 Jan 2026 18:50:10 +0000 (13:50 -0500)
src/bin/unit_test_attribute.c
src/tests/unit/all.mk

index 955acaa7e29e77275586fbd84d3ec7a81662c104..33a6d0a1b53d7cf32af9b01abad73ea1bbac7f62 100644 (file)
@@ -4539,7 +4539,7 @@ int main(int argc, char *argv[])
        /*
         *      Read test commands from stdin
         */
-       if (argc < 2) {
+       if ((argc < 2) && !receipt_dir) {
                if (write_filename) {
                        ERROR("Can only use '-w' with input files");
                        EXIT_WITH_FAILURE;
@@ -4582,7 +4582,7 @@ int main(int argc, char *argv[])
                                if ((ret != EXIT_SUCCESS) || exit_now) break;
                        }
 
-       } else {
+       } else if (argc > 1) {
                int i;
 
                /*
@@ -4592,7 +4592,7 @@ int main(int argc, char *argv[])
                        ret = process_path(&exit_now, autofree, &config, argv[i]);
                        if ((ret != EXIT_SUCCESS) || exit_now) break;
                }
-       }
+       } /* nothing to do */
 
        /*
         *      Try really hard to free any allocated
index 3402b6a459a5a84f3c7b5eed4f95e78ecfa0b9cb..94978f27835b7369957a0648b91c0eca2b6f9ffb 100644 (file)
@@ -90,12 +90,12 @@ $(filter $(BUILD_DIR)/tests/unit/purify/%,$(FILES.$(TEST))): PURIFY=-p
 $(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/%,$?)
+       ${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/%,$(filter-out build/%,$?))
 
 $(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/%,$?)
+       ${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/%,$(filter-out build/%,$?))
 
 #
 #  And the actual script to run each test.