]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
tests: check-config and check-integration require installed version
authorPetr Špaček <petr.spacek@nic.cz>
Mon, 13 Nov 2017 12:55:29 +0000 (13:55 +0100)
committerPetr Špaček <petr.spacek@nic.cz>
Mon, 13 Nov 2017 13:04:30 +0000 (14:04 +0100)
Path to module directory gets hardcoded into binaries so check-config
and check-integration cannot work prior installation.

To indicate this depedency, the target check-config was moved from
"check" target to "installcheck".

Deckard requires additional libraries so it is not included in
installcheck.

fixes: #272

tests/config/test_config.mk
tests/tests.mk

index 65ba5eedbfac8027f7e277de46927ce52c3e388b..86822f121a0b79502fda1204fa19dd950f011a1f 100644 (file)
@@ -8,7 +8,7 @@
 tests_lua := \
        hints
 
-check-config:
+check-config: check-install-precond
        $(foreach test,$(tests_lua), \
                @echo "config-test: $(test)" ;\
                export TMP_RUNDIR=`mktemp -d` ;\
index 965510514573e5c3fb25f6189b010d202e649ffd..ff079f04021777e555dd99685ac1ead617ad46a1 100644 (file)
@@ -32,8 +32,11 @@ REAL_CURDIR=$(realpath $(CURDIR))
 $(deckard_DIR)/Makefile:
        @git submodule update --init --recursive
 
-check-integration: $(deckard_DIR)/Makefile
-       $(if $(findstring $(REAL_CURDIR),$(REAL_PREFIX)),, $(warning Warning: PREFIX does not point into source directory; testing the installed version!))
+check-install-precond:
+       $(if $(findstring $(REAL_CURDIR),$(REAL_PREFIX)),, $(warning Warning: PREFIX does not point into source directory; testing version in $(PREFIX)!))
+
+# Deckard requires additional depedencies so it is not part of installcheck
+check-integration: check-install-precond $(deckard_DIR)/Makefile
        $(if $(SUBMODULES_DIRTY), $(warning Warning: Git submodules are not up-to-date),)
        @mkdir -p $(deckard_DIR)/contrib/libswrap/obj
        +TESTS=$(TESTS) DAEMON=$(abspath $(SBINDIR)/kresd) TEMPLATE=$(TEMPLATE) $(preload_syms) $(deckard_DIR)/kresd_run.sh
@@ -41,7 +44,10 @@ check-integration: $(deckard_DIR)/Makefile
 deckard: check-integration
 
 # Targets
-tests: check-unit check-config
+tests: check-unit
+# installcheck requires kresd to be installed in its final destination
+# (DESTDIR is not supported right now because module path gets hardcoded)
+installcheck: check-config
 tests-clean: $(foreach test,$(tests_BIN),$(test)-clean) mock_cmodule-clean $(CLEAN_DNSTAP)
 
-.PHONY: tests tests-clean check-integration deckard
+.PHONY: check-integration deckard installcheck tests tests-clean