Re: [PATCH v2 2/2] test: replace use of gdb with LD_PRELOAD shims in

Subject: Re: [PATCH v2 2/2] test: replace use of gdb with LD_PRELOAD shims in

Date: Sun, 16 Jun 2019 12:38:54 -0400

To: Tomi Ollila, Notmuch Mail


From: Daniel Kahn Gillmor

On Sun 2019-06-16 14:35:53 +0300, Tomi Ollila wrote:
> On Mon, Jun 10 2019, Daniel Kahn Gillmor wrote:
>> +    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"'

hm, i think your proposal would do the right thing, but if someone was
to "clobber those variables in the call path" as you put it -- or if it
ended up getting evaluated by a subshell that didn't have those
variables exported, it would fail.

Furthermore, when test_expect_code fails, at least one of the failure
paths prints out the literal string that it received as the "$2"
argument, so it's nice to have the literal string fully-expanded before
it gets passed to test_expect_code.

So for both of those reasons (fragility of variables in the callpath;
and clearer test failure reporting) i prefer the way i've done it even
if it is a bit harder to read.

I won't fight too hard about this though, i've got other things on my
plate with a higher priority.  So if you want to offer a third variant
of bremner's patches with your preferred approach, i'll probably be ok
with it.

signature.asc (application/pgp-signature)
notmuch mailing list