From: Tomi Ollila Date: Sat, 28 May 2016 12:39:28 +0000 (+0300) Subject: [PATCH v2 1/3] test-lib.sh: renamed die...()s to trap...()s and exit...() X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=455751d9297e15163e3a53741f27b2d065a05c38;p=notmuch-archives.git [PATCH v2 1/3] test-lib.sh: renamed die...()s to trap...()s and exit...() --- diff --git a/eb/221348c3130cc98ffa22404d2b957ad3360660 b/eb/221348c3130cc98ffa22404d2b957ad3360660 new file mode 100644 index 000000000..6f45fc032 --- /dev/null +++ b/eb/221348c3130cc98ffa22404d2b957ad3360660 @@ -0,0 +1,103 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 5B4126DE01EE + for ; Sat, 28 May 2016 05:40:04 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.252 +X-Spam-Level: +X-Spam-Status: No, score=0.252 tagged_above=-999 required=5 tests=[AWL=0.261, + HEADER_FROM_DIFFERENT_DOMAINS=0.001, T_RP_MATCHES_RCVD=-0.01] + autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id GWR6zVFDt4yC for ; + Sat, 28 May 2016 05:39:55 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by arlo.cworth.org (Postfix) with ESMTP id C2CB56DE0127 + for ; Sat, 28 May 2016 05:39:54 -0700 (PDT) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id 7E4651000B3; Sat, 28 May 2016 15:39:42 +0300 (EEST) +From: Tomi Ollila +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 +Message-Id: <1464439170-25978-1-git-send-email-tomi.ollila@iki.fi> +X-Mailer: git-send-email 2.8.2 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 28 May 2016 12:40:04 -0000 + +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//g' \ +-- +2.8.2 +