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 1DC45429E21 for ; Thu, 17 Nov 2011 04:20:27 -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 ya1Ud6aqBwn7 for ; Thu, 17 Nov 2011 04:20:26 -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 1F851431FD0 for ; Thu, 17 Nov 2011 04:20:25 -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 pAHCKJBB011190; Thu, 17 Nov 2011 14:20:19 +0200 From: Tomi Ollila To: Jameson Graef Rollins , Dmitry Kurochkin , notmuch@notmuchmail.org Subject: Re: [PATCH 0/9] test: (hopefully) better test prerequisites In-Reply-To: <874ny36rhc.fsf@servo.finestructure.net> References: <1321494986-18998-1-git-send-email-dmitry.kurochkin@gmail.com> <874ny36rhc.fsf@servo.finestructure.net> 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: Thu, 17 Nov 2011 12:20:27 -0000 On Thu, 17 Nov 2011 01:14:07 -0800, Jameson Graef Rollins wrote: > > However, when I tried to test the tests with the patch applied I ran > into one problem. If I try to run the test suite with dtach > uninstalled, it looks like I'm experiencing a hang on > emacs_deliver_message call. I wonder if either emacs_deliver_message or > test_emacs is not doing the right thing in the case of no dtach. I > think emacs_deliver_message should somehow not require dtach, since it's > not actually testing any display stuff, but because it's currently using > test_emacs, it is somehow implicitly depending on it. Any thoughts on > how to fix that? Quick thought mk_skip_test_emacs () { test_emacs () { echo SKIPPED false } test_emacs } mk_run_test_emacs () { test_emacs () { emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)" } test_emacs } test_emacs () { which dtach >/dev/null 2>&1 || { mk_skip_test_emacs; return; } which emacs >/dev/null 2>&1 || { mk_skip_test_emacs; return; } which emacsclient >/dev/null 2>&1 || { mk_skip_test_emacs; return; } EMACS_SERVER="notmuch-test-suite-$$" # start a detached session with an emacs server # user's TERM is given to dtach which assumes a minimally # VT100-compatible terminal -- and emacs inherits that TERM=$ORIGINAL_TERM dtach -n "$TMP_DIRECTORY/emacs-dtach-socket.$$" \ sh -c "stty rows 24 cols 80; exec '$TMP_DIRECTORY/run_emacs' \ --no-window-system \ --eval '(setq server-name \"$EMACS_SERVER\")' \ --eval '(server-start)' \ --eval '(orphan-watchdog $$)'" || { mk_skip_test_emacs; return; } # wait until the emacs server is up for _ in 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 20 1 2 3 4 5 6 7 8 9 30 do if test_emacs '()' 2>/dev/null then mk_run_test_emacs return fi done mk_skip_test_emacs } I.e. dynamically, at run-time, re-create test_emacs function... > > jamie. Tomi