unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: J Farkas <jf.hyqohaczlksw4tx6ae@l2015aftruuq.dns007.net>,
	notmuch@notmuchmail.org
Subject: Re: T070 tests portability
Date: Tue, 05 Jan 2016 22:58:43 +0200	[thread overview]
Message-ID: <m2io37agl8.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <1451991305.14.acc64b88@201601.l2015aftruuq.dns007.net>

On Tue, Jan 05 2016, J Farkas <jf.hyqohaczlksw4tx6ae@l2015aftruuq.dns007.net> wrote:

> I'm in the process of writing insert tests, but it looks like my
> environment is somewhat older than what the current tests are running
> on.  The following two trivial changes for the original tests make those
> pass cleanly:
>
> The wc I have from GNU textutils 2.0.22 seems to produce extra
> whitespace that needs to be cleaned:
>
> diff --git a/test/T070-insert.sh b/test/T070-insert.sh
> index e7ec6a6..5864b9b 100755
> --- a/test/T070-insert.sh
> +++ b/test/T070-insert.sh
> @@ -62,3 +62,3 @@ test_begin_subtest "Insert duplicate message"
>  notmuch insert +duptag -unread < "$gen_msg_filename"
> -output=$(notmuch search --output=files "subject:insert-subject" | wc -l)
> +output=$(notmuch search --output=files "subject:insert-subject" | echo $(wc -l))

For this we have found solution earlier, unfortunately this did not get it:

 output=$((`notmuch search --output=files "subject:insert-subject" | wc -l`))

$ fgrep '$((`' test/*.sh
test/T060-count.sh:    "$((`notmuch search --output=messages '*' | wc -l`))" \
test/T060-count.sh:    "$((`notmuch search --output=messages '*' | wc-l`))" \
test/T060-count.sh:    "$((`notmuch search --output=threads '*' | wc -l`))" \
test/T060-count.sh:    "$((`notmuch search '*' | wc -l`))" \
test/T060-count.sh:    "$((`notmuch search --output=files '*' | wc -l`))" \

i.e. arithmetic evaluation with just the number removes surrounding whitespace.

>  test_expect_equal "$output" 2
>
> And without the following cast, gdb 7.4 complains about the return type.
>
>     index-file-XAPIAN_EXCEPTION.gdb:7: Error in sourced command file:
>     Return value type not available for selected stack frame.
>     Please use an explicit cast of the value to return.
>
> diff --git a/test/T070-insert.sh b/test/T070-insert.sh
> index e7ec6a6..5864b9b 100755
> --- a/test/T070-insert.sh
> +++ b/test/T070-insert.sh
> @@ -196,3 +196,3 @@ break notmuch_database_add_message
>  commands
> -return NOTMUCH_STATUS_$code
> +return (int)NOTMUCH_STATUS_$code
>  continue

The page https://sourceware.org/gdb/onlinedocs/gdb/Returning.html
talks something about gdb not knowing the return type if function
was compiled without debug info... well, is this is the reason,
perhaps we should allow testing w/o debug info compiled in.

> Does any of the above look reasonable to reduce the false positives?
> With the above, the T070 tests all pass on my system.

1st is to be changed to be consistent w/ other code, second may be good.


> Janos


Tomi

  reply	other threads:[~2016-01-05 20:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05 10:55 T070 tests portability J Farkas
2016-01-05 20:58 ` Tomi Ollila [this message]
2016-01-05 21:41   ` David Bremner
2016-01-06 13:51     ` J Farkas
2016-01-07 21:50       ` Tomi Ollila
2016-01-08 19:23         ` David Bremner

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=m2io37agl8.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=jf.hyqohaczlksw4tx6ae@l2015aftruuq.dns007.net \
    --cc=notmuch@notmuchmail.org \
    /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).