From: Dmitry Kurochkin Date: Sun, 29 Jan 2012 03:36:02 +0000 (+0400) Subject: [PATCH 1/2] test: auto load elisp tests file in test_emacs if available X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=717f4cd0dd547aa1caa53d9dbecda42145b0f3fc;p=notmuch-archives.git [PATCH 1/2] test: auto load elisp tests file in test_emacs if available --- diff --git a/e6/8a38a8f691b63d53fd836dfb0195456837e33b b/e6/8a38a8f691b63d53fd836dfb0195456837e33b new file mode 100644 index 000000000..6c44fa17e --- /dev/null +++ b/e6/8a38a8f691b63d53fd836dfb0195456837e33b @@ -0,0 +1,90 @@ +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 36C11431FBC + for ; Sat, 28 Jan 2012 19:37:16 -0800 (PST) +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 Gj7-xp6Ga2Lr for ; + Sat, 28 Jan 2012 19:37:15 -0800 (PST) +Received: from mail-bk0-f53.google.com (mail-bk0-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 85D62431FAE + for ; Sat, 28 Jan 2012 19:37:15 -0800 (PST) +Received: by bke11 with SMTP id 11so412812bke.26 + for ; Sat, 28 Jan 2012 19:37:12 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; + h=from:to:subject:date:message-id:x-mailer; + bh=IWDKpoOKiVYKfL1NE5baAXbX3aD+b9r6gnQUFL2Tn5w=; + b=U28ZKvc6wCOtt0iYsBE9LPHIysFbAVKuhJKur/DS2oZC0xm6J4fm+b25gS4HO/Vbv9 + 61FawPAMa//AsChKd2Dj2XyBmJz6aRf4T/AJmqCvVIPAUjfTFGGaSrV4GAH18R4txecx + aK44Vz/2npPSVVlHBFgMD3LvLHEwBaem6C81E= +Received: by 10.205.132.1 with SMTP id hs1mr5698976bkc.45.1327808232690; + Sat, 28 Jan 2012 19:37:12 -0800 (PST) +Received: from localhost ([91.144.186.21]) + by mx.google.com with ESMTPS id d2sm27445167bky.11.2012.01.28.19.37.11 + (version=TLSv1/SSLv3 cipher=OTHER); + Sat, 28 Jan 2012 19:37:12 -0800 (PST) +From: Dmitry Kurochkin +To: notmuch@notmuchmail.org +Subject: [PATCH 1/2] test: auto load elisp tests file in test_emacs if + available +Date: Sun, 29 Jan 2012 07:36:02 +0400 +Message-Id: <1327808163-31483-1-git-send-email-dmitry.kurochkin@gmail.com> +X-Mailer: git-send-email 1.7.8.3 +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: Sun, 29 Jan 2012 03:37:16 -0000 + +This allows us to simplify shell part of tests written in elisp. +--- + test/test-lib.sh | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +diff --git a/test/test-lib.sh b/test/test-lib.sh +index 8158328..0174e93 100644 +--- a/test/test-lib.sh ++++ b/test/test-lib.sh +@@ -943,6 +943,12 @@ test_emacs () { + test -z "$missing_dependencies" || return + + if [ -z "$EMACS_SERVER" ]; then ++ emacs_tests="$(basename $0).el" ++ if [ -f "$TEST_DIRECTORY/$emacs_tests" ]; then ++ load_emacs_tests="--eval '(load \"$emacs_tests\")'" ++ else ++ load_emacs_tests= ++ fi + server_name="notmuch-test-suite-$$" + # start a detached session with an emacs server + # user's TERM is given to dtach which assumes a minimally +@@ -950,6 +956,7 @@ test_emacs () { + TERM=$ORIGINAL_TERM dtach -n "$TEST_TMPDIR/emacs-dtach-socket.$$" \ + sh -c "stty rows 24 cols 80; exec '$TMP_DIRECTORY/run_emacs' \ + --no-window-system \ ++ $load_emacs_tests \ + --eval '(setq server-name \"$server_name\")' \ + --eval '(server-start)' \ + --eval '(orphan-watchdog $$)'" || return +-- +1.7.8.3 +