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 E6CED429E5A for ; Mon, 27 Jun 2011 21:45:52 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 D4vHHf-EjGHL for ; Mon, 27 Jun 2011 21:45:52 -0700 (PDT) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 743FC429E4F for ; Mon, 27 Jun 2011 21:45:48 -0700 (PDT) Received: by mail-bw0-f53.google.com with SMTP id 12so4889638bwg.26 for ; Mon, 27 Jun 2011 21:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=h9cKKZlPlt9rSWT6ty29oEmYh2+xmj9zuMK2JGdj26I=; b=OGuK0iE1ypE0GT0rdQ8LEgCTPk3VlotRR4nMPsbsAoQY5whjc16pkh2UOW+XP+5hSd cYgO+TW6a/0asadGgH0OQEit7O7TM6k8ZndvF/y5Xd4pLVba+1jgY2WB0YBj730ASfpE s0CHo5/41DC2YS/lUy6gYVsMyvv4QD+eLjMbI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=B2Q4kcpfQNgZCpOxjw7HBMdYVcNacLqTc4kRzv5l3gjt51JKWlClnFim2uJz92iI4Y wflsSUj+ppq0eu5gGSNhaD5YYxOq3RErdWyu7HVEZOcAESye950Za1DdU7+1WJIeaU4f ywiNZdk7LeIC83jqTnKCnLFgz1Jn4Z2OaetIc= Received: by 10.204.19.19 with SMTP id y19mr4985846bka.164.1309236348166; Mon, 27 Jun 2011 21:45:48 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id g13sm2876238bkd.10.2011.06.27.21.45.47 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 27 Jun 2011 21:45:47 -0700 (PDT) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH 09/10] test: generate run_emacs script once on test startup Date: Tue, 28 Jun 2011 08:45:10 +0400 Message-Id: <1309236311-2162-9-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1309236311-2162-1-git-send-email-dmitry.kurochkin@gmail.com> References: <1309236311-2162-1-git-send-email-dmitry.kurochkin@gmail.com> 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: Tue, 28 Jun 2011 04:45:53 -0000 Instead of generating auxiliary run_emacs script every time test_emacs is run, do it once in the beginning of the test. Also, use absolute paths in the script to make it more robust. --- test/test-lib.sh | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index 7c8a86f..48bace2 100755 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -839,11 +839,11 @@ test_done () { fi } -test_emacs () { +emacs_generate_script () { # Construct a little test script here for the benefit of the user, # (who can easily run "run_emacs" to get the same emacs environment # for investigating any failures). - cat < run_emacs + cat <"$TMP_DIRECTORY/run_emacs" #!/bin/sh export PATH=$PATH export NOTMUCH_CONFIG=$NOTMUCH_CONFIG @@ -867,12 +867,15 @@ fi # --load Force loading of notmuch.el and test-lib.el emacs \$BATCH --no-init-file --no-site-file \ - --directory ../../emacs --load notmuch.el \ - --directory .. --load test-lib.el \ + --directory "$TMP_DIRECTORY/../../emacs" --load notmuch.el \ + --directory "$TMP_DIRECTORY/.." --load test-lib.el \ --eval "(progn \$@)" EOF - chmod a+x ./run_emacs - ./run_emacs "$@" + chmod a+x "$TMP_DIRECTORY/run_emacs" +} + +test_emacs () { + "$TMP_DIRECTORY/run_emacs" "$@" } @@ -1000,6 +1003,8 @@ primary_email=test_suite@notmuchmail.org other_email=test_suite_other@notmuchmail.org;test_suite@otherdomain.org EOF +emacs_generate_script + # Use -P to resolve symlinks in our working directory so that the cwd # in subprocesses like git equals our $PWD (for pathname comparisons). -- 1.7.5.4