mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-19 11:31:26 +01:00
24289 plus Ismail's suggestion 24290: count test scripts succeeded and failed
This commit is contained in:
parent
1ee6295909
commit
f8585a7c21
5 changed files with 79 additions and 17 deletions
|
@ -1,3 +1,10 @@
|
|||
2007-12-18 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* 24289 plus change suggested by Ismail in 24290:
|
||||
Test/Makefile.in, Test/runtests.zsh, Test/ztst.zsh,
|
||||
Test/.distfiles: count successful and unsuccessful scripts
|
||||
and report with status.
|
||||
|
||||
2007-12-18 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 24279: Src/jobs.c, Src/zle_main.c, Src/zle_thingy.c: allow
|
||||
|
|
|
@ -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
|
||||
'
|
||||
|
|
|
@ -45,11 +45,17 @@ check test:
|
|||
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
|
||||
rm -rf Modules .zcompdump
|
||||
if 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; then \
|
||||
stat=0; \
|
||||
else \
|
||||
stat=1; \
|
||||
fi; \
|
||||
rm -rf Modules .zcompdump; \
|
||||
exit $$stat
|
||||
|
||||
# ========== DEPENDENCIES FOR CLEANUP ==========
|
||||
|
||||
|
|
23
Test/runtests.zsh
Normal file
23
Test/runtests.zsh
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/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}
|
||||
**************************************"
|
||||
return $(( failure ? 1 : 0 ))
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue