Re: [PATCH 2/4] test: due not pass T380.1 for the wrong reasons

Subject: Re: [PATCH 2/4] test: due not pass T380.1 for the wrong reasons

Date: Wed, 09 Feb 2022 22:49:18 +0200

To: Michael J Gruber, notmuch@notmuchmail.org

Cc:

From: Tomi Ollila


On Wed, Feb 09 2022, Michael J. Gruber wrote:

> If gdb is missing then some files are never written to so that the
> comparisons of non-existing files succeeds for the wrong reason,
> claiming that `notmch new` is idempotent when it was in fact never run.
>
> Catch this and (for lack of a better spot) set up the files with a
> reason for the FAIL.
>
> Signed-off-by: Michael J Gruber <git@grubix.eu>
> ---
>  test/T380-atomicity.sh | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/test/T380-atomicity.sh b/test/T380-atomicity.sh
> index a6f1e037..7f618062 100755
> --- a/test/T380-atomicity.sh
> +++ b/test/T380-atomicity.sh
> @@ -90,6 +90,10 @@ if test_require_external_prereq gdb; then
>  	    i=$(expr $end - 1)
>  	fi
>      done
> +else
> +    echo -n "Test fails due to missing gdb." > searchall
> +    echo -n > expectall

I am not much of a fan of 'echo -n' (I remember seeing -n (and newline
echoed...), therefore first to use printf and second : > expectall
(unless printf '' > expectall)

> +    outcount=0
>  fi
>  
>  test_begin_subtest '"notmuch new" is idempotent under arbitrary aborts'
> -- 
> 2.35.1.306.ga00bde9711
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: