unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Milton Vandersloot <miltonrobertvandersloot1412@protonmail.com>,
	"notmuch@notmuchmail.org" <notmuch@notmuchmail.org>
Cc: Tomi Ollila <tomi.ollila@iki.fi>
Subject: Re: test_emacs_expect_t does ignore Emacs as prerequisite
Date: Fri, 24 Apr 2020 07:29:54 -0300	[thread overview]
Message-ID: <871rodkwgt.fsf@tethera.net> (raw)
In-Reply-To: <4EC8sDKjAVEjYY1U-bmmhcOzj4Sekf_jKwOaaduMv3Oes4rNecwwrOLmvYbFwjGVd_5BW6PEeK7M0iMUKgOkHEwyETf-mjJqFexnKkqSUNM=@protonmail.com>

Milton Vandersloot <miltonrobertvandersloot1412@protonmail.com> writes:
>
> [PATCH] Let test_emacs_expect_t respect missing external prerequisites
>
> test_emacs_expect_t did not test for missing prerequisites (even though
> it called test_emacs which does it). Fix that by testing for missing
> prerequisites.
>

I agree there's a bug here, but I'm not sure this is the best/cleanest
fix. Maybe Tomi (in Cc) can comment. The logic for prerequisite checking
is already opaque. For example test_skip is already calling
test_check_missing_external_prereqs_ as a side effect. For starters I
wonder if test_emacs should use a return value to indicate failure,
along the lines of the patch at the end of the message.

BTW, it will make our life easier if you follow
https://notmuchmail.org/contributing/#index5h2; in particular using
git-send-email and keeping the discussion/notes after ---.


diff --git a/test/test-lib.sh b/test/test-lib.sh
index 7f8a3a4d..eecc52f7 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -543,9 +543,8 @@ test_emacs_expect_t () {
 	# Run the test.
 	if ! test_skip "$test_subtest_name"
 	then
-		test_emacs "(notmuch-test-run $1)" >/dev/null
-
-		# Restore state after the test.
+		test_emacs "(notmuch-test-run $1)" || return
+                # Restore state after the test.
 		exec 1>&6 2>&7		# Restore stdout and stderr
 		inside_subtest=
 
@@ -997,7 +996,7 @@ test_emacs () {
 	test_require_external_prereq dtach || missing_dependencies=1
 	test_require_external_prereq emacs || missing_dependencies=1
 	test_require_external_prereq ${TEST_EMACSCLIENT} || missing_dependencies=1
-	test -z "$missing_dependencies" || return
+	test -z "$missing_dependencies" || return 1
 
 	if [ -z "$EMACS_SERVER" ]; then
 		emacs_tests="$NOTMUCH_SRCDIR/test/${this_test_bare}.el"
@@ -1034,6 +1033,7 @@ test_emacs () {
 	touch OUTPUT
 
 	${TEST_EMACSCLIENT} --socket-name="$EMACS_SERVER" --eval "(notmuch-test-progn $*)"
+        return 0
 }
 
 test_python() {

  reply	other threads:[~2020-04-24 10:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-05  8:37 test_emacs_expect_t does ignore Emacs as prerequisite Milton Vandersloot
2020-04-24 10:29 ` David Bremner [this message]
2020-04-26  8:12   ` Tomi Ollila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rodkwgt.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=miltonrobertvandersloot1412@protonmail.com \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).