Re: [PATCH v4 1/5] test: treat undefined feature variables as 0

Subject: Re: [PATCH v4 1/5] test: treat undefined feature variables as 0

Date: Tue, 11 Jul 2023 18:11:59 +0300

To: David Bremner, notmuch@notmuchmail.org

Cc:

From: Tomi Ollila


On Sun, Jul 09 2023, David Bremner wrote:

> When running the test suite without building first, it is desirable to
> have the tests consider these variables being undefined as equivalent
> to the feature not being present, and in particular for the tests not
> to generate errors.
> ---
...
> diff --git a/test/T392-python-cffi-notmuch.sh b/test/T392-python-cffi-notmuch.sh
> index 15c8fc6b..5a6dd1bf 100755
> --- a/test/T392-python-cffi-notmuch.sh
> +++ b/test/T392-python-cffi-notmuch.sh
> @@ -2,7 +2,7 @@
>  test_description="python bindings (notmuch test suite)"
>  . $(dirname "$0")/test-lib.sh || exit 1
>  
> -if [ $NOTMUCH_HAVE_PYTHON3_CFFI -eq 0 -o $NOTMUCH_HAVE_PYTHON3_PYTEST -eq 0 ]; then
> +if [ "${NOTMUCH_HAVE_PYTHON3_CFFI-0}" = "0" -o "${NOTMUCH_HAVE_PYTHON3_PYTEST}" = "0" ]; then

here ensuring NOTMUCH_HAVE_PYTHON3_PYTEST is defined is missing...

>      test_done
>  fi
>  
...
> diff --git a/test/T850-git.sh b/test/T850-git.sh
> index 55cec78a..a063aacf 100755
> --- a/test/T850-git.sh
> +++ b/test/T850-git.sh
> @@ -2,7 +2,7 @@
>  test_description='"notmuch git" to save and restore tags'
>  . $(dirname "$0")/test-lib.sh || exit 1
>  
> -if [ $NOTMUCH_HAVE_SFSEXP -ne 1 ]; then
> +if [ "${NOTMUCH_HAVE_SFSEXP}" != "1" ]; then

here ensuring NOTMUCH_HAVE_SFSEXP is defined is missing

>      printf "Skipping due to missing sfsexp library\n"
>      test_done
>  fi
> -- 
> 2.40.1
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: