From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 225EB431FBC for ; Thu, 11 Feb 2010 13:42:19 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -3.215 X-Spam-Level: X-Spam-Status: No, score=-3.215 tagged_above=-999 required=5 tests=[ALL_TRUSTED=-1.8, AWL=1.184, BAYES_00=-2.599] autolearn=ham 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 JegPAP-UlwIN; Thu, 11 Feb 2010 13:42:18 -0800 (PST) Received: from yoom.home.cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 08CB8431FAE; Thu, 11 Feb 2010 13:42:17 -0800 (PST) Received: by yoom.home.cworth.org (Postfix, from userid 1000) id 8C27025416E; Thu, 11 Feb 2010 13:42:15 -0800 (PST) From: Carl Worth To: Michal Sojka , notmuch@notmuchmail.org In-Reply-To: <201002081614.24284.sojkam1@fel.cvut.cz> References: <87ljf8pvxx.fsf@yoom.home.cworth.org> <87hbpwpoko.fsf@yoom.home.cworth.org> <5641883d1002060727ia4e6c16lf800a92fc8735430@mail.gmail.com> <201002081614.24284.sojkam1@fel.cvut.cz> Date: Thu, 11 Feb 2010 13:42:08 -0800 Message-ID: <871vgr78lr.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Subject: Re: A functional (but rudimentary) test suite for notmuch 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, 11 Feb 2010 21:42:19 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable Hi Michal, I found myself today *really* needing to add a test that exercises some code in our emacs client. (Eric found that a message that includes a ":" in the From: address breaks things due to a buggy regexp.) And I wanted to see if I could merge your conversion of the test suite before I added a feature as big as that. See below for my feedback. =2DCarl On Mon, 8 Feb 2010 16:14:24 +0100, Michal Sojka wrote: > I converted the actual version of notmuch-test to git test framework. > The result is in the followup patches. Interesting. My only real concern at this point is that some of the new fil= es have a copyright header identifying Junio as the copyright holder, but no license information. Meanwhile, the implicit license of git (GPLv2 only) is incompatible with that of notmuch (GPLv3+). So if you'd like to ask Junio for permission to re-use the files under the GPLv3+ then we could see what he says. In the meantime, you've done some nice modularization work here which we should be able to take right away, (and I can write tiny implementations of the functions we need so that we can just drop in git's test-lib.sh if we get permission). So we won't yet have any of the fancy features of the framework, (expected failures, reports of fixed tests, pre-requisites for tests), but we're not *using* any of those features yet so it shouldn't matter. > The conversion was not as straightforward as I expected mainly because > of problems with quoting. There are several sources of quotation problems > one being Carl's hashed array parameters. I thing it would be > sufficient to use plain variables for passing additional parameters. > Instead of: > add_message [from]=3D"\"Sender \"" \ > [to]=3Dtest_suite@notmuchmail.org \ ... > I'd do: > msg_from=3D"Sender " > msg_to=3Dtest_suite@notmuchmail.org=20 > add_message Yeah. I almost wrote it that way, but named parameters (even if faked) seemed so much nicer. I'll agree that the quoting was quite nasty though. > A possible additional improvement is elimination of > execute_expecting(). Combination of action (running notmuch) and > testing of a result in a single function makes it hard to distinguish > whether the problem is in the action or in the output. A fair point. It also caused problems when I wanted to do tests that didn't directly test the output of notmuch, (such as a test that uses diff to compare a result against the contents in a file). =2DCarl --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iD8DBQFLdHmw6JDdNq8qSWgRAlm+AJ9DL5aZugC0VXQf9Xt00FdQV8vlywCfQfoS HuKcqix5K++HS4S7CSUg+LQ= =X+JG -----END PGP SIGNATURE----- --=-=-=--