unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] test: fix test_require_external_prereq gdb in insert test
@ 2014-10-28 17:52 Jani Nikula
  2014-10-28 18:15 ` David Bremner
  0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2014-10-28 17:52 UTC (permalink / raw)
  To: notmuch

You need to actually check the return value. Limit the missing deps
part to subtests requiring gdb.
---
 test/T070-insert.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/T070-insert.sh b/test/T070-insert.sh
index 168345c9897b..b21609833228 100755
--- a/test/T070-insert.sh
+++ b/test/T070-insert.sh
@@ -2,8 +2,6 @@
 test_description='"notmuch insert"'
 . ./test-lib.sh
 
-test_require_external_prereq gdb
-
 # Create directories and database before inserting.
 mkdir -p "$MAIL_DIR"/{cur,new,tmp}
 mkdir -p "$MAIL_DIR"/Drafts/{cur,new,tmp}
@@ -185,6 +183,8 @@ test_expect_code 1 "Invalid tags set exit code" \
 
 notmuch config set new.tags $OLDCONFIG
 
+if test_require_external_prereq gdb; then
+
 # DUPLICATE_MESSAGE_ID is not tested here, because it should actually pass.
 
 for code in OUT_OF_MEMORY XAPIAN_EXCEPTION FILE_NOT_EMAIL \
@@ -211,4 +211,6 @@ gdb --batch-silent --return-child-result -x index-file-$code.gdb \
 test_expect_equal $? 0
 done
 
+fi # gdb
+
 test_done
-- 
2.1.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] test: fix test_require_external_prereq gdb in insert test
  2014-10-28 17:52 [PATCH] test: fix test_require_external_prereq gdb in insert test Jani Nikula
@ 2014-10-28 18:15 ` David Bremner
  2014-10-28 19:43   ` Jani Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: David Bremner @ 2014-10-28 18:15 UTC (permalink / raw)
  To: Jani Nikula, notmuch

Jani Nikula <jani@nikula.org> writes:

> You need to actually check the return value. Limit the missing deps
> part to subtests requiring gdb.

For me, on a system without gdb, the current version looks like

T070-insert: Testing "notmuch insert"
 missing prerequisites: gdb(1)
 SKIP   all tests in T070-insert

This seems OK to me?

Of course you're right that moving it forward to only skip the gdb
requiring tests is the right thing to do, and in that setting having a
skipped message for all 10 skipped tests is a bit ugly. OTOHO your
version doesn't give any output at all, which seems not perfect either.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] test: fix test_require_external_prereq gdb in insert test
  2014-10-28 18:15 ` David Bremner
@ 2014-10-28 19:43   ` Jani Nikula
  2014-10-28 20:56     ` David Bremner
  0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2014-10-28 19:43 UTC (permalink / raw)
  To: David Bremner, notmuch

On Tue, 28 Oct 2014, David Bremner <david@tethera.net> wrote:
> Jani Nikula <jani@nikula.org> writes:
>
>> You need to actually check the return value. Limit the missing deps
>> part to subtests requiring gdb.
>
> For me, on a system without gdb, the current version looks like
>
> T070-insert: Testing "notmuch insert"
>  missing prerequisites: gdb(1)
>  SKIP   all tests in T070-insert
>
> This seems OK to me?

More than okay. /me hides.

> Of course you're right that moving it forward to only skip the gdb
> requiring tests is the right thing to do, and in that setting having a
> skipped message for all 10 skipped tests is a bit ugly. OTOHO your
> version doesn't give any output at all, which seems not perfect either.

How does it work if you just move the prereq test forward?

BR,
Jani.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] test: fix test_require_external_prereq gdb in insert test
  2014-10-28 19:43   ` Jani Nikula
@ 2014-10-28 20:56     ` David Bremner
  0 siblings, 0 replies; 4+ messages in thread
From: David Bremner @ 2014-10-28 20:56 UTC (permalink / raw)
  To: Jani Nikula, notmuch

Jani Nikula <jani@nikula.org> writes:


>> Of course you're right that moving it forward to only skip the gdb
>> requiring tests is the right thing to do, and in that setting having a
>> skipped message for all 10 skipped tests is a bit ugly. OTOHO your
>> version doesn't give any output at all, which seems not perfect either.
>
> How does it work if you just move the prereq test forward?
>

Then we get one message per skipped test. So twenty lines it total.

 missing prerequisites: gdb(1)
 SKIP   error exit when add_message returns OUT_OF_MEMORY
 missing prerequisites: gdb(1)
 SKIP   success exit with --keep when add_message returns OUT_OF_MEMORY
 missing prerequisites: gdb(1)
 SKIP   error exit when add_message returns XAPIAN_EXCEPTION
 missing prerequisites: gdb(1)
 SKIP   success exit with --keep when add_message returns XAPIAN_EXCEPTION
 missing prerequisites: gdb(1)
 SKIP   error exit when add_message returns FILE_NOT_EMAIL
 missing prerequisites: gdb(1)
 SKIP   success exit with --keep when add_message returns FILE_NOT_EMAIL
 missing prerequisites: gdb(1)
 SKIP   error exit when add_message returns READ_ONLY_DATABASE
 missing prerequisites: gdb(1)
 SKIP   success exit with --keep when add_message returns READ_ONLY_DATABASE
 missing prerequisites: gdb(1)
 SKIP   error exit when add_message returns UPGRADE_REQUIRED
 missing prerequisites: gdb(1)
 SKIP   success exit with --keep when add_message returns UPGRADE_REQUIRED

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-28 20:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-28 17:52 [PATCH] test: fix test_require_external_prereq gdb in insert test Jani Nikula
2014-10-28 18:15 ` David Bremner
2014-10-28 19:43   ` Jani Nikula
2014-10-28 20:56     ` David Bremner

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).