[PATCH] tests: add compatibility layer

Tomi Ollila tomi.ollila at iki.fi
Tue Jan 3 07:52:15 PST 2017


On Tue, Jan 03 2017, Tomi Ollila <tomi.ollila at iki.fi> wrote:

>
> To fix the above, one could use (possibly better written) mkwrap()
> implementation, or do all of those by hand: e.g.
>
> if command -v gdate >/dev/null; then date () { gdate "$@"; }; fi
> if command -v gbase64 >/dev/null; then base64 () { gbase64 "$@"; }; fi
> ...
>
> the gdb wrapper could be dumped completely and have the following in
> test-lib-common.sh:
>
> : ${NOTMUCH_GDB:-gdb}

Argh, the above would not work, but this: 

: ${NOTMUCH_GDB:=gdb}

emphasis++ ftw \o/ ! ;)

Tomi

>
> and then replace all (the few) gdb in code with $NOTMUCH_GDB (did not use
> quotes like "$NOTMUCH_GDB" so that one can hack args there.
>
> but if the gdb function were there, then the following might work:
>
> gdb () { command ${NOTMUCH_GDB:-gdb} "$@"; }
>


More information about the notmuch mailing list