Re: [PATCH 0/6] Rebase of Pieter's "set test prereqs"
authorThomas Jost <schnouki@schnouki.net>
Wed, 16 Nov 2011 20:17:48 +0000 (21:17 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:14 +0000 (09:40 -0800)
5d/b1791c20dff4add14d0a954dff5056cb34abc7 [new file with mode: 0644]

diff --git a/5d/b1791c20dff4add14d0a954dff5056cb34abc7 b/5d/b1791c20dff4add14d0a954dff5056cb34abc7
new file mode 100644 (file)
index 0000000..6ea0d83
--- /dev/null
@@ -0,0 +1,164 @@
+Return-Path: <schnouki@schnouki.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 331D0429E21\r
+       for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 12:17:58 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.1\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id DCWJMFo5RyaQ for <notmuch@notmuchmail.org>;\r
+       Wed, 16 Nov 2011 12:17:57 -0800 (PST)\r
+Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222])\r
+       by olra.theworths.org (Postfix) with ESMTP id 40F33431FD0\r
+       for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 12:17:57 -0800 (PST)\r
+Received: from odin.local (4va54-1-87-88-247-156.dsl.sta.abo.bbox.fr\r
+       [87.88.247.156])\r
+       by ks3536.kimsufi.com (Postfix) with ESMTPSA id E4CE96A0026;\r
+       Wed, 16 Nov 2011 21:17:55 +0100 (CET)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net;\r
+       s=key-schnouki; t=1321474676;\r
+       bh=MJ0WxhgBvokOeMHfg5h5P3W6fvH2SpzCXN4IcT1lqnc=;\r
+       h=From:To:Subject:In-Reply-To:References:Date:Message-ID:\r
+       MIME-Version:Content-Type;\r
+       b=SpCgzxu+j3XUmyIqiH6+xzUWdKWG0VmGgqyfl8IwdmR679EW8HqgCu4OvxLBikRip\r
+       H1iKkK3TPbW4ZeP5rDc+xWBuUf9jtDAHmYdfkPnShRnPpPzo0LNHhLJTCqOeFTF4jf\r
+       U75Sx2RS3xrlL0rwCKZT7ISl0xJdiuw/RDD97yXc=\r
+From: Thomas Jost <schnouki@schnouki.net>\r
+To: Jameson Graef Rollins <jrollins@finestructure.net>,\r
+ notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 0/6] Rebase of Pieter's "set test prereqs"\r
+In-Reply-To: <87lirf99vt.fsf@servo.finestructure.net>\r
+References: <1320176954-4897-1-git-send-email-pieter@praet.org>\r
+       <1321454035-22023-1-git-send-email-schnouki@schnouki.net>\r
+       <87lirf99vt.fsf@servo.finestructure.net>\r
+User-Agent: Notmuch/0.10_rc1+21~gaf76c55 (http://notmuchmail.org)\r
+       Emacs/24.0.90.1 (x86_64-unknown-linux-gnu)\r
+Date: Wed, 16 Nov 2011 21:17:48 +0100\r
+Message-ID: <87zkfv95zn.fsf@schnouki.net>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 16 Nov 2011 20:17:58 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Wed, 16 Nov 2011 10:53:42 -0800, Jameson Graef Rollins <jrollins@finestr=\r
+ucture.net> wrote:\r
+> On Wed, 16 Nov 2011 15:33:49 +0100, Thomas Jost <schnouki@schnouki.net> w=\r
+rote:\r
+> > Hello list,\r
+> >=20\r
+> > This is another rebased version of Pieter's series to add GPG and Emacs=\r
+ as test\r
+> > prereqs, plus some additions on my own. (Rebased and posted as requeste=\r
+d by\r
+> > Pieter [1].)\r
+> >=20\r
+> > Changes as compared to Pieter's patches (including parts from [2]):\r
+> > - prereqs are not tested using test_expect_success as they were in Piet=\r
+er's\r
+> >   original patches, but using a new function called test_set_bin_prereq=\r
+. I wrote\r
+> >   this before the gdb prereq was added, hence the different way to set =\r
+it.\r
+>=20\r
+> Hey, Thomas.  Thanks so much for this work.  This sounds like a better\r
+> solution.\r
+>=20\r
+> However, in the patches you send I see a lot of changes of the form\r
+>=20\r
+>   -test_expect_success 'emacs delivery of encrypted message with attachme=\r
+nt' \\r
+>   +test_expect_success GPG 'emacs delivery of encrypted message with atta=\r
+chment' \\r
+>=20\r
+> and\r
+>=20\r
+>   -test_expect_equal \\r
+>   +test_expect_equal GPG \\r
+>=20\r
+> which seems to contradict what you've said above.  Not to mention that I\r
+> don't see anything that modifies calls to the test_expect_ functions.\r
+> Basically I see a lot more in the diffs than I would have expected in a\r
+> cursory look.  Is this just a rebase flub, or is there something I'm\r
+> missing?\r
+>=20\r
+> jamie.\r
+\r
+Hi Jamie,\r
+\r
+I guess I wasn't clear in my explanations :)\r
+\r
+Pieter's patches use this to detect the presence of GPG/Emacs and set\r
+the prereq:\r
+\r
+    +# GnuPG is a prereq.\r
+    +test_expect_success "prereq: GnuPG is present" "which gpg" \\r
+    +    && test_set_prereq GPG\r
+\r
+There are 2 problems with this approach:=20\r
+\r
+=2D test_expect_success returns 0 regardless of the actual result of the\r
+  command it runs. So even if gpg is not installed,=20\r
+    text_expect_success "..." "which gpg"\r
+  will succeed, and "test_set_prereq GPG" will be run.\r
+  This, however, has been fixed in commit 003e7180 -- which had not been\r
+  pushed when I wrote this in the first place :)\r
+\r
+=2D using test_expect_* to set a prereq does not make sense. If emacs is\r
+  absent, the test suite would report a failed test. But a missing\r
+  prereq is *not* a notmuch issue, so this should *not* be reported as a\r
+  failed test.\r
+\r
+Hence my first patch, which defines test_set_bin_prereq, a new helper\r
+function to set a prereq without using any test_expect_*.\r
+\r
+After that we can use the normal prereq syntax from the test suite:\r
+=2D test_expect_success COMMAND --> run COMMAND, expecting it to succeed\r
+=2D test_expect_success PREREQ COMMAND --> skip if PREREQ is not set, else\r
+  run the test as before\r
+(and same thing with the other test_expect_* functions)\r
+\r
+Does it make more sense now?\r
+\r
+Regards,\r
+\r
+=2D-=20\r
+Thomas/Schnouki\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.11 (GNU/Linux)\r
+\r
+iQEcBAEBAgAGBQJOxBptAAoJEMPdciX+bh5IabgH/3voa/YJjklax+LokiZr2B/J\r
+BcqVAsT5D1pcNPdO+P4LFppIepjxmR6GnLJbX3kzmjb8/p9eV39qGzrGlK2VDs8v\r
+h6aLZ9jx5UkSMHRBEZxwRD2yeJkiv3KsCj37pvhtH39gEoinEpCZqtimSCZMahNm\r
+/rM+IB8Y4ZNOuz1S/l3v47XSOltoHUgy8WGwjQKiihcb0aJmw30QREdNiYMqaT0v\r
+PM8MiVmRHeuv56pbSFqh1IHCNemb0XzU/TeZD1rW2Y0wzMQcbKyiTpw5sHtxhZuD\r
+NgpW/vsjaOLGIiWL+1Z8NIbIXfanOaYST5MQZ6uqfKWbpqrB2nZ4w/D3Qxr7B10=\r
+=hEq/\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r