From: Ian Jackson Date: Sun, 20 Oct 2019 12:04:29 +0000 (+0100) Subject: build system: Break out test-common.make X-Git-Tag: v0.5.0~59 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=commitdiff_plain;h=001316f26a63d531d9b29d543f31679b41c8a203 build system: Break out test-common.make Signed-off-by: Ian Jackson --- diff --git a/.gitignore b/.gitignore index c9dbd00..1b9c248 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ conffile.yy.[ch] /config.stamp.in Makefile /common.make +/test-common.make msgcode-test msgcode-test.confirm diff --git a/configure b/configure index 58cabb8..e600caa 100755 --- a/configure +++ b/configure @@ -4735,7 +4735,7 @@ else $as_echo "$as_me: WARNING: Disabling IPv6 support" >&2;} fi -ac_config_files="$ac_config_files Makefile common.make test-example/Makefile stest/Makefile" +ac_config_files="$ac_config_files Makefile common.make test-common.make test-example/Makefile stest/Makefile" ac_config_commands="$ac_config_commands default" @@ -5437,6 +5437,7 @@ do "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "common.make") CONFIG_FILES="$CONFIG_FILES common.make" ;; + "test-common.make") CONFIG_FILES="$CONFIG_FILES test-common.make" ;; "test-example/Makefile") CONFIG_FILES="$CONFIG_FILES test-example/Makefile" ;; "stest/Makefile") CONFIG_FILES="$CONFIG_FILES stest/Makefile" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; diff --git a/configure.in b/configure.in index 65997ef..40f2d70 100644 --- a/configure.in +++ b/configure.in @@ -96,7 +96,8 @@ else AC_MSG_WARN([Disabling IPv6 support]) fi -AC_OUTPUT(Makefile common.make test-example/Makefile stest/Makefile, +AC_OUTPUT(Makefile common.make test-common.make + test-example/Makefile stest/Makefile, echo timestamp >config.stamp) AH_TOP([ diff --git a/stest/Makefile.in b/stest/Makefile.in index dad720e..40ef0db 100644 --- a/stest/Makefile.in +++ b/stest/Makefile.in @@ -3,20 +3,14 @@ VPATH:=@srcdir@ srcdir:=@srcdir@ topdir:=@top_srcdir@ -include ../common.make - -TARGETS=udp-preload.so check - -TESTSCRIPTS ?= $(shell echo $(srcdir)/t-*[0-9a-z]) -TESTNAMES := $(patsubst t-%,%,$(notdir $(TESTSCRIPTS))) +TARGETS += udp-preload.so DEPS += udp-preload.so DEPS += $(srcdir)/common.tcl -DEPS += $(topdir)/test-common.tcl DEPS += ../secnet DEPS += ../test-example/sites.conf -all: $(TARGETS) +include ../test-common.make CFLAGS += -D_REENTRANT -fPIC @@ -40,16 +34,3 @@ MAKE_NOTSPECIAL:=$(MAKE) check: env -u MAKEFLAGS -u MFLAGS \ $(MAKE_NOTSPECIAL) -j$(shell nproc || 1)0 check-real - -check-real: $(foreach t,$(TESTNAMES),d-$t/ok) - -d-%/ok: $(srcdir)/t-% $(DEPS) - @rm -rf d-$*; mkdir d-$* - export STEST_BUILDDIR=$(topbuilddir); \ - cd $(topdir) && stest/t-$* >$(topbuilddir)/stest/d-$*/log 2>&1 - @printf "$* " - @touch $@ - -clean: - $(RM) -f *.o *.so - $(RM) -rf tmp diff --git a/test-common.make.in b/test-common.make.in new file mode 100644 index 0000000..fb82335 --- /dev/null +++ b/test-common.make.in @@ -0,0 +1,25 @@ + +include ../common.make + +TESTSCRIPTS ?= $(shell echo $(srcdir)/t-*[0-9a-z]) +TESTNAMES := $(patsubst t-%,%,$(notdir $(TESTSCRIPTS))) + +DEPS += $(topdir)/test-common.tcl + +TARGETS += check + +all: $(TARGETS) + +check-real: $(foreach t,$(TESTNAMES),d-$t/ok) + +d-%/ok: $(srcdir)/t-% $(DEPS) + @rm -rf d-$*; mkdir d-$* + export STEST_BUILDDIR=$(topbuilddir); \ + cd $(topdir) && stest/t-$* >$(topbuilddir)/stest/d-$*/log 2>&1 + @printf "$* " + @touch $@ + +clean: + $(RM) -f *.o *.so + $(RM) -rf tmp + $(RM) -rf d-*