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

Daniel Kahn Gillmor dkg at fifthhorseman.net
Sun Jun 16 09:38:54 PDT 2019


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.

    --dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20190616/ef1c9d80/attachment.sig>


More information about the notmuch mailing list