chiark / gitweb /
build system: Break out test-common.make
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 20 Oct 2019 12:04:29 +0000 (13:04 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 24 Oct 2019 18:16:15 +0000 (19:16 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
.gitignore
configure
configure.in
stest/Makefile.in
test-common.make.in [new file with mode: 0644]

index c9dbd00..1b9c248 100644 (file)
@@ -16,6 +16,7 @@ conffile.yy.[ch]
 /config.stamp.in
 Makefile
 /common.make
+/test-common.make
 
 msgcode-test
 msgcode-test.confirm
index 58cabb8..e600caa 100755 (executable)
--- 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" ;;
index 65997ef..40f2d70 100644 (file)
@@ -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([
index dad720e..40ef0db 100644 (file)
@@ -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 (file)
index 0000000..fb82335
--- /dev/null
@@ -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-*