Re: [Patch v3 08/11] test: define GMime version dependant breakage

2017-05-29 Thread Tomi Ollila
On Sat, May 27 2017, David Bremner wrote:

> We have some tests where the gmime 3 behaviour seems like a bug fix,
> others where it's less clear, so we allow both possibilities.
> ---
>  configure|  5 +
>  test/test-lib.sh | 16 
>  2 files changed, 21 insertions(+)
>
> diff --git a/configure b/configure
> index 91aeba51..c5e2ffed 100755
> --- a/configure
> +++ b/configure
> @@ -489,11 +489,13 @@ if pkg-config --exists "gmime-3.0"; then
>  have_gmime=1
>  gmime_cflags=$(pkg-config --cflags gmime-3.0)
>  gmime_ldflags=$(pkg-config --libs gmime-3.0)
> +gmime_major=3
>  elif pkg-config --exists "gmime-2.6 >= $GMIME_MINVER"; then
>  printf "Yes (2.6).\n"
>  have_gmime=1
>  gmime_cflags=$(pkg-config --cflags gmime-2.6)
>  gmime_ldflags=$(pkg-config --libs gmime-2.6)
> +gmime_major=2
>  else
>  have_gmime=0
>  printf "No.\n"
> @@ -1212,6 +1214,9 @@ NOTMUCH_PYTHON=${python}
>  # building/testing ruby bindings.
>  NOTMUCH_HAVE_RUBY_DEV=${have_ruby_dev}
>  
> +# Major version of gmime
> +NOTMUCH_GMIME_MAJOR=${gmime_major}
> +
>  # Platform we are run on
>  PLATFORM=${platform}
>  EOF
> diff --git a/test/test-lib.sh b/test/test-lib.sh
> index 37f8ddfa..093481c3 100644
> --- a/test/test-lib.sh
> +++ b/test/test-lib.sh
> @@ -1202,6 +1202,22 @@ test_init_ () {
>  
>  . ./test-lib-common.sh || exit 1

series lgtm so far (afaiu)

>  
> +if [ "${NOTMUCH_GMIME_MAJOR}" = 3 ]; then
> +function test_subtest_broken_gmime_3 () {
> + 
> +}

s/function // i.e. no `function` keyword (unnecessary and we don't use
those elsewhere)

Too bad bash(1) is picky enough not supporting 
test_subtest_broken_gmime_3 () test_subtest_known_broken
(i.e. w/o {}s like other shells do)

> +function test_subtest_broken_gmime_2 () {
> + /bin/true

/bin/true runs external command unnecessarily, plain `true` would
execute internal shell command.

> +}
> +else
> +function test_subtest_broken_gmime_3 () {

> + /bin/true
> +}
> +function test_subtest_broken_gmime_2 () {
> + test_subtest_known_broken
> +}
> +fi
> +
>  emacs_generate_script
>  
>  
> -- 
> 2.11.0
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [Patch v3 06/11] test/thread-naming: remove excess escaping from sender address.

2017-05-29 Thread Tomi Ollila
On Sat, May 27 2017, David Bremner wrote:

> This is another case where the behaviour of gmime-2.6 and gmime-3.0
> seems to differ. It may be that we prefer the more lax parsing of the
> previous version, but that should be tested seperately.

This series lgtm (afaiu) so far, but s/seper/separ/ above. In 04/11 `shuf`
adds to coreutils dependencies, but that is in perf test...

> ---
>  test/T200-thread-naming.sh | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/test/T200-thread-naming.sh b/test/T200-thread-naming.sh
> index 132c1d77..2167ba8e 100755
> --- a/test/T200-thread-naming.sh
> +++ b/test/T200-thread-naming.sh
> @@ -66,11 +66,11 @@ test_expect_equal "$output" "thread:XXX   2001-01-12 
> [6/8] Notmuch Test Suite; t
>  test_begin_subtest "Use empty subjects if necessary."
>  add_message '[subject]="@FORCE_EMPTY"' \
>   '[date]="Sat, 13 Jan 2001 15:43:45 -"' \
> -'[from]="Empty Sender \"'
> +'[from]="Empty Sender "'
>  empty_parent=${gen_msg_id}
>  add_message '[subject]="@FORCE_EMPTY"' \
>   '[date]="Sun, 14 Jan 2001 15:43:45 -"' \
> -'[from]="Empty Sender \"' \
> +'[from]="Empty Sender "' \
>  "[in-reply-to]=\<$empty_parent\>"
>  output=$(notmuch search --sort=newest-first from:empty_t...@notmuchmail.org 
> | notmuch_search_sanitize)
>  test_expect_equal "$output" "thread:XXX   2001-01-14 [2/2] Empty Sender;  
> (inbox unread)"
> @@ -78,15 +78,15 @@ test_expect_equal "$output" "thread:XXX   2001-01-14 
> [2/2] Empty Sender;  (inbox
>  test_begin_subtest "Avoid empty subjects if possible (newest-first)."
>  add_message '[subject]="Non-empty subject (1)"' \
>   '[date]="Mon, 15 Jan 2001 15:43:45 -"' \
> -'[from]="Empty Sender \"' \
> +'[from]="Empty Sender "' \
>  "[in-reply-to]=\<$empty_parent\>"
>  add_message '[subject]="Non-empty subject (2)"' \
>   '[date]="Mon, 16 Jan 2001 15:43:45 -"' \
> -'[from]="Empty Sender \"' \
> +'[from]="Empty Sender "' \
>  "[in-reply-to]=\<$empty_parent\>"
>  add_message '[subject]="@FORCE_EMPTY"' \
>   '[date]="Tue, 17 Jan 2001 15:43:45 -"' \
> -'[from]="Empty Sender \"' \
> +'[from]="Empty Sender "' \
>  "[in-reply-to]=\<$empty_parent\>"
>  output=$(notmuch search --sort=newest-first from:Empty | 
> notmuch_search_sanitize)
>  test_expect_equal "$output" "thread:XXX   2001-01-17 [5/5] Empty Sender; 
> Non-empty subject (2) (inbox unread)"
> -- 
> 2.11.0
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch