[Patch v3 03/11] lib/cli: add library API / CLI for compile time options

Tomi Ollila tomi.ollila at iki.fi
Sat May 7 09:02:51 PDT 2016


On Sun, May 01 2016, David Bremner <david at tethera.net> wrote:

so far so good, (CXXLAGS does not need more mentioning ;)

> diff --git a/test/T030-config.sh b/test/T030-config.sh
> index f404908..a4e24c3 100755
> --- a/test/T030-config.sh
> +++ b/test/T030-config.sh
> @@ -44,7 +44,7 @@ test_expect_equal "$(notmuch config get foo.nonexistent)" ""
>  
>  test_begin_subtest "List all items"
>  notmuch config set database.path "/canonical/path"
> -output=$(notmuch config list)
> +output=$(notmuch config list | notmuch_options_sanitize)

notmuch_built_with_sanitize ? ------/\

>  test_expect_equal "$output" "\
>  database.path=/canonical/path
>  user.name=Notmuch Test Suite
> @@ -56,7 +56,9 @@ search.exclude_tags=
>  maildir.synchronize_flags=true
>  crypto.gpg_path=gpg
>  foo.string=this is another string value
> -foo.list=this;is another;list value;"
> +foo.list=this;is another;list value;
> +built_with.compact=something
> +built_with.field_processor=something"
>  
>  test_begin_subtest "Top level --config=FILE option"
>  cp "${NOTMUCH_CONFIG}" alt-config
> diff --git a/test/T040-setup.sh b/test/T040-setup.sh
> index cf0c00b..be2f0db 100755
> --- a/test/T040-setup.sh
> +++ b/test/T040-setup.sh
> @@ -19,7 +19,7 @@ another.suite at example.com
>  foo bar
>  baz
>  EOF
> -output=$(notmuch --config=new-notmuch-config config list)
> +output=$(notmuch --config=new-notmuch-config config list | notmuch_built_with_sanitize)
>  test_expect_equal "$output" "\
>  database.path=/path/to/maildir
>  user.name=Test Suite
> @@ -29,6 +29,8 @@ new.tags=foo;bar;
>  new.ignore=
>  search.exclude_tags=baz;
>  maildir.synchronize_flags=true
> -crypto.gpg_path=gpg"
> +crypto.gpg_path=gpg
> +built_with.compact=something
> +built_with.field_processor=something"
>  
>  test_done
> diff --git a/test/test-lib.sh b/test/test-lib.sh
> index ac04b15..09f8731 100644
> --- a/test/test-lib.sh
> +++ b/test/test-lib.sh
> @@ -733,6 +733,12 @@ notmuch_uuid_sanitize ()
>  {
>      sed 's/[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}/UUID/g'
>  }
> +
> +notmuch_built_with_sanitize ()
> +{
> +    sed 's/^built_with[.]\(.*\)=.*$/built_with.\1=something/'
> +}

The above looks good. In this case I think this would work too

    sed '/^built_with/ s/=.*/=something/'

hmm. simpler, but less educational ;)


Tomi


> +
>  # End of notmuch helper functions
>  
>  # Use test_set_prereq to tell that a particular prerequisite is available.
> -- 
> 2.8.0.rc3


More information about the notmuch mailing list