[Pkg-zsh-commits] [zsh] 01/01: Add test-suite wrapper and adequate test for DEP8 as-installed testing

Axel Beckert abe at deuxchevaux.org
Sun Sep 14 20:55:27 UTC 2014


This is an automated email from the git hooks/post-receive script.

abe pushed a commit to branch debian
in repository zsh.

commit 0ef12ed3cb844d90ed681ba879bb86207bf2323e
Author: Axel Beckert <abe at deuxchevaux.org>
Date:   Sun Sep 14 22:55:02 2014 +0200

    Add test-suite wrapper and adequate test for DEP8 as-installed testing
---
 debian/tests/adequate      |  6 +++++
 debian/tests/control       |  5 ++++
 debian/tests/run-testsuite | 58 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 69 insertions(+)

diff --git a/debian/tests/adequate b/debian/tests/adequate
new file mode 100755
index 0000000..1792a98
--- /dev/null
+++ b/debian/tests/adequate
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Very simple test to run adequate on all zsh packages. To be used with
+# Debian's autopkgtest package. Author: Axel Beckert <abe at debian.org>
+
+adequate `awk '$1 == "Package:" {print $2}' < debian/control` >&2
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..e722554
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,5 @@
+Tests: run-testsuite
+Depends: zsh
+
+Tests: adequate
+Depends: @, adequate
diff --git a/debian/tests/run-testsuite b/debian/tests/run-testsuite
new file mode 100755
index 0000000..10d3b7b
--- /dev/null
+++ b/debian/tests/run-testsuite
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+set -e
+
+# Run zsh's test suite on installed zsh
+#
+# Code based upon check/test target in Test/Makefile.in
+
+#if test -n "$(DLLD)"; then
+#    cd $(dir_top) && DESTDIR= $(MAKE) MODDIR=`pwd`/$(subdir)/Modules install.modules
+#fi
+
+if [ -z "$ADTTMP" -o ! -d "$ADTTMP" ]; then
+    echo '$ADTTMP ("'"$ADTTMP"'") is not set or not a directory' 1>&2
+    exit 2
+fi
+
+ZTST_testdir="$ADTTMP/Test"
+export ZTST_testdir
+
+cp -pvr Test "$ZTST_testdir"
+cp -pvr Misc "$ADTTMP/Misc"
+cd "$ADTTMP"
+
+ln -vfs /usr/lib/*/zsh/*.*.* "$ZTST_testdir/Modules"
+ln -vfs /usr/share/zsh/functions Functions
+ln -vfs /usr/share/zsh/functions/Completion .
+mkdir -pv Src
+for f in /bin/zsh*; do
+    ln -vfs "$f" Src/
+done
+
+cd "$ZTST_testdir"
+
+# For now skip a bunch of tests which require artefacts from the build
+# config.modules maybe mocked by creating it from the installed modules.
+rm -v V01zmodload.ztst
+
+# Drop explicit fpath setting from some files
+for f in ztst.zsh comptest; do
+    perl -E 'local $/; my $code = <>; $code =~ s{\n *fpath=\(.*?\n\n}{\n\n}s; print $code' -i $f
+done
+
+ZTST_testlist="`for f in $ZTST_testdir/$TESTNUM*.ztst; do echo $f; done`" \
+ZTST_srcdir="$ZTST_testdir"
+ZTST_exe=/bin/zsh
+export ZTST_testlist
+export ZTST_srcdir
+export ZTST_exe
+
+if "$ZTST_exe" +Z -f "$ZTST_testdir/runtests.zsh"; then
+    stat=0
+else
+    stat=1
+fi
+sleep 1
+rm -rf Modules .zcompdump
+exit $$stat

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/zsh.git



More information about the Pkg-zsh-commits mailing list