[PATCH v2 2/2] test: replace use of gdb with LD_PRELOAD shims in T070-insert.sh

Tomi Ollila tomi.ollila at iki.fi
Sun Jun 16 04:35:53 PDT 2019


On Mon, Jun 10 2019, Daniel Kahn Gillmor wrote:

> diff --git a/test/T070-insert.sh b/test/T070-insert.sh
> index 48165caa..017124fc 100755
> --- a/test/T070-insert.sh
> +++ b/test/T070-insert.sh
> @@ -266,30 +264,18 @@ gen_insert_msg
>  
>  for code in  FILE_NOT_EMAIL READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR; do
>      test_begin_subtest "EXIT_FAILURE when index_file returns $code"
> -    test_expect_code 1 \
> -         "${TEST_GDB} --batch-silent --return-child-result \
> -	     -ex 'set args insert < $gen_msg_filename' \
> -	     -x index-file-$code.gdb notmuch"
> +    test_expect_code 1 "$(printf "notmuch_with_shim shim-%q insert < %q" "$code" "$gen_msg_filename")"

does   test_expect_code 1 'notmuch_with_shim shim-$code insert < "$gen_msg_filename"'

i.e $code and "$gen_msg_filename" are evaluated by eval instead when given
as an argument to test_expect_code

to me it look like is what get executed in test_run_ (called by
test_expect_code) and neither of the 2 variables are clobbered
in the call path :D

    eval >&3 2>&4 'notmuch_with_shim shim-$code insert < "$gen_msg_filename"'


Tomi


More information about the notmuch mailing list