From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: trap DEBUG + set -o DEBUG_BEFORE_CMD not setting $? nonzero in current CVS
Date: Wed, 6 Aug 2008 09:49:58 +0100 [thread overview]
Message-ID: <20080806094958.064c04e1@news01> (raw)
In-Reply-To: <6cd6de210808051625n3ee7156bw468cbbd1418615c3@mail.gmail.com>
On Tue, 5 Aug 2008 19:25:58 -0400
"Rocky Bernstein" <rocky.bernstein@gmail.com> wrote:
> I didn't have a problem writing a program that when run gives exit
> code 0 if this bug is fixed and exit code 10 if not.
>
> I tried from checked out sources from a couple days ago when there was
> a bug versus currently patched sources. It probably shouldn't be too
> hard to work this into the testing system.
I'll put it in as is. I think I may have confused myself over the fact
that I head the shell in two states: before fixing the first bug, and after
fixing the second bug, and this condition didn't turn up. It's worth
testing for.
The previous test depends on DEBUG_BEFORE_CMD not being set.
Index: Test/C03traps.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/C03traps.ztst,v
retrieving revision 1.12
diff -u -r1.12 C03traps.ztst
--- Test/C03traps.ztst 5 Aug 2008 08:41:24 -0000 1.12
+++ Test/C03traps.ztst 6 Aug 2008 08:48:04 -0000
@@ -350,6 +350,7 @@
>trap
>Working 0
+ unsetopt DEBUG_BEFORE_CMD
debug-trap-bug1() {
setopt localtraps
print "print bug file here" >bug-file
@@ -388,6 +389,19 @@
>bug file here
>EXIT hit
+ cat >zsh-trapreturn-bug2 <<-'HERE'
+ cmd='./fdasfsdafd'
+ [[ -x $cmd ]] && rm $cmd
+ set -o DEBUG_BEFORE_CMD
+ trap '[[ $? -ne 0 ]] && exit 0' DEBUG
+ $cmd # invalid command
+ # Failure
+ exit 10
+ HERE
+ $ZTST_testdir/../Src/zsh -f ./zsh-trapreturn-bug2
+0: trapreturn handling bug is properly fixed
+?./zsh-trapreturn-bug2:5: no such file or directory: ./fdasfsdafd
+
%clean
rm -f TRAPEXIT
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
prev parent reply other threads:[~2008-08-06 8:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-04 10:08 Rocky Bernstein
2008-08-04 17:49 ` Peter Stephenson
2008-08-05 8:33 ` Peter Stephenson
2008-08-05 23:25 ` Rocky Bernstein
2008-08-06 8:49 ` Peter Stephenson [this message]
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=20080806094958.064c04e1@news01 \
--to=pws@csr.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).