Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 9F5EB429E21 for ; Wed, 16 Nov 2011 11:09:04 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id msZcE5vcQxKQ for ; Wed, 16 Nov 2011 11:09:04 -0800 (PST) Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id D8256431FD0 for ; Wed, 16 Nov 2011 11:09:03 -0800 (PST) Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pAGJ90f7015068 for ; Wed, 16 Nov 2011 21:09:00 +0200 From: Tomi Ollila To: Subject: [PATCH] test: create TEST_TMPDIR for holding temporary files User-Agent: Notmuch/0.9+73~ged20210 (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Wed, 16 Nov 2011 19:09:04 -0000 The TEST_TMPDIR if first needed to hold dtach's socket (due to 108-character limit in socket file names). Later it can be used to hold other temporary files; directory deleted at exit. --- I'm not fully satisfied with variable name -- compare to the use of TEST_DIRECTORY. Anyway it is the best I could come up with -- to not invent yet one more naming convention. Sometime in the future we could rework the variable names to have more consistent format. test/test-lib.sh | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index 1ea7fa9..4cd0157 100755 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -174,6 +174,7 @@ test_success=0 die () { code=$? + rm -rf "$TEST_TMPDIR" if test -n "$GIT_EXIT_OK" then exit $code @@ -184,6 +185,8 @@ die () { } GIT_EXIT_OK= +# Note: TEST_TMPDIR *NOT* exported! +TEST_TMPDIR=$(mktemp -d "${TMPDIR:-/tmp}/notmuch-test-$$.XXXXXX") trap 'die' EXIT test_decode_color () { -- 1.7.7.3