unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: notmuch@notmuchmail.org
Cc: tomi.ollila@iki.fi
Subject: [PATCH v2 1/3] test-lib.sh: renamed die...()s to trap...()s and exit...()
Date: Sat, 28 May 2016 15:39:28 +0300	[thread overview]
Message-ID: <1464439170-25978-1-git-send-email-tomi.ollila@iki.fi> (raw)

Now the function names more accurately describes what the functions do.
---

V2 of id:1460525704-15145-1-git-send-email-tomi.ollila@iki.fi

Thanks to David's review this series (or this first patch)
is so much better.

 test/test-lib.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/test/test-lib.sh b/test/test-lib.sh
index 201d0ebb94bb..fa9f9beec4f2 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -223,15 +223,15 @@ test_fixed=0
 test_broken=0
 test_success=0
 
-_die_common () {
+_exit_common () {
 	code=$?
 	trap - EXIT
 	set +ex
 	rm -rf "$TEST_TMPDIR"
 }
 
-die () {
-	_die_common
+trap_exit () {
+	_exit_common
 	if test -n "$GIT_EXIT_OK"
 	then
 		exit $code
@@ -245,8 +245,8 @@ die () {
 	fi
 }
 
-die_signal () {
-	_die_common
+trap_signal () {
+	_exit_common
 	echo >&6 "FATAL: $0: interrupted by signal" $((code - 128))
 	exit $code
 }
@@ -254,8 +254,8 @@ die_signal () {
 GIT_EXIT_OK=
 # Note: TEST_TMPDIR *NOT* exported!
 TEST_TMPDIR=$(mktemp -d "${TMPDIR:-/tmp}/notmuch-test-$$.XXXXXX")
-trap 'die' EXIT
-trap 'die_signal' HUP INT TERM
+trap 'trap_exit' EXIT
+trap 'trap_signal' HUP INT TERM
 
 test_decode_color () {
 	sed	-e 's/.\[1m/<WHITE>/g' \
-- 
2.8.2

             reply	other threads:[~2016-05-28 12:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-28 12:39 Tomi Ollila [this message]
2016-05-28 12:39 ` [PATCH v2 2/3] test: add function die () and have use of it in add_email_corpus () Tomi Ollila
2016-05-28 12:39 ` [PATCH v2 3/3] test: fix die() in test-lib-common.sh Tomi Ollila
2016-06-11 16:24 ` [PATCH v2 1/3] test-lib.sh: renamed die...()s to trap...()s and exit...() David Bremner

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

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464439170-25978-1-git-send-email-tomi.ollila@iki.fi \
    --to=tomi.ollila@iki.fi \
    --cc=notmuch@notmuchmail.org \
    /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://yhetil.org/notmuch.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).