diff options
-rw-r--r-- | debian/tests/control | 9 | ||||
-rwxr-xr-x | debian/tests/run-testsuite-static | 62 |
2 files changed, 71 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control index 2bd45fc98..ddc395e1c 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -7,6 +7,15 @@ Depends: libcap-dev [linux-any], zsh, zsh-dev +Tests: run-testsuite-static +Depends: libcap-dev [linux-any], + libelf-dev, + libgdbm-dev, + libncurses-dev, + libpcre3-dev, + zsh-static, + zsh-dev + Tests: adequate Depends: adequate:native, @ diff --git a/debian/tests/run-testsuite-static b/debian/tests/run-testsuite-static new file mode 100755 index 000000000..192725745 --- /dev/null +++ b/debian/tests/run-testsuite-static @@ -0,0 +1,62 @@ +#!/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 "$AUTOPKGTEST_TMP" -o ! -d "$AUTOPKGTEST_TMP" ]; then + echo '$AUTOPKGTEST_TMP ("'"$AUTOPKGTEST_TMP"'") is not set or not a directory' 1>&2 + exit 2 +fi + +ZTST_testdir="$AUTOPKGTEST_TMP/Test" +export ZTST_testdir + +cp -pvr Test "$ZTST_testdir" +cp -pvr Misc "$AUTOPKGTEST_TMP/Misc" +cd "$AUTOPKGTEST_TMP" + +ln -vfs /usr/lib/*/zsh/[0-9]* "$ZTST_testdir/Modules" +ln -vfs /usr/share/zsh/functions Functions +ln -vfs /usr/share/zsh/functions/Completion . +ln -vfs /usr/include/zsh/config.modules . +mkdir -pv Src +ln -vfs /bin/zsh-static Src/zsh +ln -vfs /bin/zsh5-static Src/zsh5 + +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 + +# Also skip PCRE tests (./configure --enable-pcre "may create run-time +# library dependencies") +rm -v V07pcre.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-static +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 |