From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: PATCH: count test failures
Date: Tue, 18 Dec 2007 20:52:14 +0000 [thread overview]
Message-ID: <26213.1198011134@pws-pc> (raw)
This adds an intermediate script in the Test directory to report test
scripts that succeeded and failed. This is for lazy people who can't be
bothered to scroll the terminal. We already make far more demands of
the shell in ztst.zsh than in runtests.zsh, so I can't see an obvious
problem. But I'm sure you'll let me know.
Index: Test/.distfiles
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/.distfiles,v
retrieving revision 1.19
diff -u -r1.19 .distfiles
--- Test/.distfiles 1 Aug 2007 21:38:35 -0000 1.19
+++ Test/.distfiles 18 Dec 2007 20:48:10 -0000
@@ -1,15 +1,41 @@
DISTFILES_SRC='
+.cvsignore
.distfiles
-.cvsignore B01cd.ztst D03procsubst.ztst Y02compmatch.ztst
-C01arith.ztst D04parameter.ztst Y03arguments.ztst
-A01grammar.ztst C02cond.ztst D05array.ztst comptest
-A02alias.ztst C03traps.ztst E02xtrace.ztst
-A03quoting.ztst C04funcdef.ztst Makefile.in ztst.zsh
-A04redirect.ztst D01prompt.ztst V02zregexparse.ztst
-A05execution.ztst D02glob.ztst Y01completion.ztst
-D06subscript.ztst D07multibyte.ztst D08cmdsubst.ztst
-V01zmodload.ztst E01options.ztst
-B02typeset.ztst B03print.ztst A06assign.ztst B04read.ztst
-V03mathfunc.ztst V04features.ztst V05styles.ztst
+A01grammar.ztst
+A02alias.ztst
+A03quoting.ztst
+A04redirect.ztst
+A05execution.ztst
+A06assign.ztst
+B01cd.ztst
+B02typeset.ztst
+B03print.ztst
+B04read.ztst
+C01arith.ztst
+C02cond.ztst
+C03traps.ztst
+C04funcdef.ztst
+D01prompt.ztst
+D02glob.ztst
+D03procsubst.ztst
+D04parameter.ztst
+D05array.ztst
+D06subscript.ztst
+D07multibyte.ztst
+D08cmdsubst.ztst
+E01options.ztst
+E02xtrace.ztst
+Makefile.in
README
+V01zmodload.ztst
+V02zregexparse.ztst
+V03mathfunc.ztst
+V04features.ztst
+V05styles.ztst
+Y01completion.ztst
+Y02compmatch.ztst
+Y03arguments.ztst
+comptest
+runtests.zsh
+ztst.zsh
'
Index: Test/Makefile.in
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/Makefile.in,v
retrieving revision 1.8
diff -u -r1.8 Makefile.in
--- Test/Makefile.in 26 Jul 2004 13:18:14 -0000 1.8
+++ Test/Makefile.in 18 Dec 2007 20:48:10 -0000
@@ -45,10 +45,11 @@
cd $(dir_top) && DESTDIR= \
$(MAKE) MODDIR=`pwd`/$(subdir)/Modules install.modules > /dev/null; \
fi
- -for f in $(sdir)/$(TESTNUM)*.ztst; do \
- ZTST_exe=$(dir_top)/Src/zsh \
- $(dir_top)/Src/zsh +Z -f $(sdir)/ztst.zsh $$f; \
- done
+ -ZTST_testlist="`for f in $(sdir)/$(TESTNUM)*.ztst; \
+ do echo $$f; done`" \
+ ZTST_srcdir="$(sdir)" \
+ ZTST_exe=$(dir_top)/Src/zsh \
+ $(dir_top)/Src/zsh +Z -f $(sdir)/runtests.zsh
rm -rf Modules .zcompdump
# ========== DEPENDENCIES FOR CLEANUP ==========
Index: Test/runtests.zsh
===================================================================
RCS file: Test/runtests.zsh
diff -N Test/runtests.zsh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Test/runtests.zsh 18 Dec 2007 20:48:10 -0000
@@ -0,0 +1,22 @@
+#!/bin/zsh -f
+
+emulate zsh
+
+# Run all specified tests, keeping count of which succeeded.
+# The reason for this extra layer above the test script is to
+# protect from catastrophic failure of an individual test.
+# We could probably do that with subshells instead.
+
+integer success failure
+for file in "${(f)ZTST_testlist}"; do
+ $ZTST_exe +Z -f $ZTST_srcdir/ztst.zsh $file
+ if (( $? )); then
+ (( failure++ ))
+ else
+ (( success++ ))
+ fi
+done
+print "**************************************
+$success successful test script${${success:#1}:+s}, \
+$failure failure${${failure:#1}:+s}
+**************************************"
Index: Test/ztst.zsh
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/ztst.zsh,v
retrieving revision 1.27
diff -u -r1.27 ztst.zsh
--- Test/ztst.zsh 29 May 2007 14:50:29 -0000 1.27
+++ Test/ztst.zsh 18 Dec 2007 20:48:10 -0000
@@ -1,4 +1,4 @@
-#!/usr/local/bin/zsh -f
+#!/bin/zsh -f
# The line above is just for convenience. Normally tests will be run using
# a specified version of zsh. With dynamic loading, any required libraries
# must already have been installed in that case.
--
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
next reply other threads:[~2007-12-18 20:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-18 20:52 Peter Stephenson [this message]
2007-12-18 20:56 ` Ismail Dönmez
2007-12-18 21:09 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=26213.1198011134@pws-pc \
--to=p.w.stephenson@ntlworld.com \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).