chiark / gitweb /
autopkgtests: Add machinery for regenerating test cases
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 18 Aug 2018 22:50:20 +0000 (23:50 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 18 Aug 2018 23:20:06 +0000 (00:20 +0100)
Sadlythe dependencies are not in the *.deb because we are a
portmanteau package, so we must put the actual shlib dependencies in
debian/tests/control.  This involves running dpkg-shlibdeps etc.

The plan is to do this occasionally and commit the result to git.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
.gitignore
Makefile
base/Makefile
base/extension.make
debian/regenerate-autopkgtests [new file with mode: 0755]
debian/rules

index 844c6d1cc4952468515464c27e4b4453fce491a6..99ee608d3cfd78d16b5be18a1b36bdc604777b14 100644 (file)
@@ -3,6 +3,7 @@
 *.so
 *.d
 test-load.tcl
+debian-substvars
 *+tcmdif.[ch]
 debian/files
 debian/libtcl-chiark-1
index 74fc544ad13fa7a8feb90bf7288f6ff5b7803427..77e9e48b1116be7fc79f2a7e63d6c929ecaf3021 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ endif
 
 default: all
 
-clean all:
+clean all debian-substvars:
        set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
 
 # To find undefined symbols when implementing, for example:
index 1bbfd21c82ec28d35a30384cf706995484a2d0b6..30c4f8faa43516139367dba10ba1092f97c5c6fd 100644 (file)
@@ -28,5 +28,7 @@ SHLIB =               $(BASE_SHLIB)
 base+tcmdif.h: $(BASE_TCT) $(TCMDIFGEN)
                $(TCMDIFGEN) -wh -o$@ $<
 
+debian-substvars: all
+
 include shlib.make
 include final.make
index ccc7407a63111f33d551c3396786bb2a5e00e3e9..80239921c95053cd35337566800680ce6d48dcef 100644 (file)
@@ -55,4 +55,8 @@ test-load:    $(SHLIB).so test-load.tcl
                @set -x; LD_LIBRARY_PATH=$(subst $(space),:,$(strip $(OTHER_DIRS)))$${LD_LIBRARY_PATH+:}$${LD_LIBRARY_PATH} \
                tclsh$(TCL_VERSION) test-load.tcl
 
+debian-substvars: all
+               set -e; d=`pwd`; cd ..; \
+               dpkg-shlibdeps -T"$$d"/$@ "$$d"/$(SHLIB).so
+
 include                $(BASE_DIR)/final.make
diff --git a/debian/regenerate-autopkgtests b/debian/regenerate-autopkgtests
new file mode 100755 (executable)
index 0000000..396df16
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+set -e
+
+dt=debian/tests
+
+rm -rf $dt
+mkdir -p $dt
+
+exec 4>$dt/control.new
+
+for sv in */debian-substvars; do
+       d=${sv%/*}
+       if ! test -e "$sv"; then continue; fi
+       make -C "$d" test-load.tcl
+       printf "%s..." $d
+       for v in "$@"; do
+               t=$d--$v
+               printf " %s" $v
+               exec 3>$dt/$t
+               echo >&3 "#!/usr/bin/tclsh$v"
+               cat >&3 "$d"/test-load.tcl
+               echo >&3 'set t {'"$d"'/runtest.tcl}'
+               echo >&3 'if {[file exists $t]} { source $t }'
+               chmod +x $dt/$t
+               echo >&4 "Tests: $t"
+               sed "s/^shlibs:Depends=/Depends: tcl$v, /" >&4 $sv
+               echo >&4
+       done
+       echo
+done
+
+mv $dt/control.new $dt/control
index 3675728eee9fcb4459de8b2e73df4b19a7bd9e8d..464159cf1542836a3b484a2096e6ac412bcb3a50 100755 (executable)
@@ -26,6 +26,8 @@ docdir=usr/share/doc/$(docpackage)
 tclh:=$(firstword $(wildcard /usr/include/tcl8.*/tcl.h))
 tclversion:=$(patsubst /usr/include/tcl%/tcl.h,%,$(tclh))
 
+tcl_versions= 8.4 8.5 8.6 8.7 8.8
+
 march := $(shell dpkg-architecture -q DEB_HOST_MULTIARCH)
 libsubdir = /$(march)
 
@@ -104,4 +106,8 @@ checkroot:
        $(checkdir)
        dh_testroot
 
+debian/tests/control: debian/regenerate-autopkgtests debian/rules
+       $(MAKE) debian-substvars
+       $< $(tcl_versions)
+
 .PHONY: binary binary-arch binary-indep clean checkroot