From: Tomi Ollila Date: Sat, 28 May 2016 12:39:30 +0000 (+0300) Subject: [PATCH v2 3/3] test: fix die() in test-lib-common.sh X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8cc7b8f010bd9026b9e86b604e5319aae5503ef4;p=notmuch-archives.git [PATCH v2 3/3] test: fix die() in test-lib-common.sh --- diff --git a/02/6e7b627e416d438756f96913afc21efc6ca07f b/02/6e7b627e416d438756f96913afc21efc6ca07f new file mode 100644 index 000000000..54f519dfc --- /dev/null +++ b/02/6e7b627e416d438756f96913afc21efc6ca07f @@ -0,0 +1,73 @@ +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 BDAC06DE02C3 + for ; Sat, 28 May 2016 05:40:11 -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 0ND5zwtGLSoB for ; + Sat, 28 May 2016 05:40:04 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by arlo.cworth.org (Postfix) with ESMTP id 3F5806DE01F7 + for ; Sat, 28 May 2016 05:39:56 -0700 (PDT) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id 1F10A1000B3; Sat, 28 May 2016 15:39:44 +0300 (EEST) +From: Tomi Ollila +To: notmuch@notmuchmail.org +Cc: tomi.ollila@iki.fi +Subject: [PATCH v2 3/3] test: fix die() in test-lib-common.sh +Date: Sat, 28 May 2016 15:39:30 +0300 +Message-Id: <1464439170-25978-3-git-send-email-tomi.ollila@iki.fi> +X-Mailer: git-send-email 2.8.2 +In-Reply-To: <1464439170-25978-1-git-send-email-tomi.ollila@iki.fi> +References: <1464439170-25978-1-git-send-email-tomi.ollila@iki.fi> +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:11 -0000 + +In scripts that include test-lib-common.sh but not test-lib.sh +the die() implementation needs to be a bit different due to +fd redirection differences. test-lib-common.sh implements die() +only if it was not implemented already. +--- + test/test-lib-common.sh | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/test/test-lib-common.sh b/test/test-lib-common.sh +index ba4a8e112084..bc2322162fd5 100644 +--- a/test/test-lib-common.sh ++++ b/test/test-lib-common.sh +@@ -18,6 +18,12 @@ + # This file contains common code to be used by both the regular + # (correctness) tests and the performance tests. + ++# test-lib.sh defines die() which echoes to nonstandard fd where ++# output was redirected earlier in that file. If test-lib.sh is not ++# loaded, neither this redirection nor die() function were defined. ++# ++type die >/dev/null 2>&1 || die () { echo "$@" >&2; exit 1; } ++ + find_notmuch_path () + { + dir="$1" +-- +2.8.2 +