TEST_GDB=${TEST_GDB:-gdb}
TEST_CC=${TEST_CC:-cc}
TEST_CFLAGS=${TEST_CFLAGS:-"-g -O0"}
+TEST_SHIM_CFLAGS=${TEST_SHIM_CFLAGS:-"-fpic -shared"}
+TEST_SHIM_LDFLAGS=${TEST_SHIM_LDFLAGS:-"-ldl"}
# Protect ourselves from common misconfiguration to export
# CDPATH into the environment
printf '%s:6:\n' "$FINGERPRINT" | gpg --quiet --batch --no-tty --import-ownertrust
}
+add_gpgsm_home ()
+{
+ local fpr
+ [ -d ${GNUPGHOME} ] && return
+ _gnupg_exit () { gpgconf --kill all 2>/dev/null || true; }
+ at_exit_function _gnupg_exit
+ mkdir -m 0700 "$GNUPGHOME"
+ gpgsm --batch --no-tty --no-common-certs-import --disable-dirmngr --import < $NOTMUCH_SRCDIR/test/smime/test.crt >"$GNUPGHOME"/import.log 2>&1
+ fpr=$(gpgsm --batch --list-key test_suite@notmuchmail.org | sed -n 's/.*fingerprint: //p')
+ echo "$fpr S relax" >> $GNUPGHOME/trustlist.txt
+ gpgsm --quiet --batch --no-tty --no-common-certs-import --disable-dirmngr --import < $NOTMUCH_SRCDIR/test/smime/ca.crt
+ echo "4D:E0:FF:63:C0:E9:EC:01:29:11:C8:7A:EE:DA:3A:9A:7F:6E:C1:0D S" >> "$GNUPGHOME/trustlist.txt"
+ test_debug "cat $GNUPGHOME/import.log"
+}
+
# Each test should start with something like this, after copyright notices:
#
# test_description='Description of this test...
notmuch_dir_sanitize OUTPUT.stdout OUTPUT.stderr > OUTPUT
}
+make_shim () {
+ base_name="$1"
+ test_file="${base_name}.c"
+ shim_file="${base_name}.so"
+ cat > ${test_file}
+ ${TEST_CC} ${TEST_CFLAGS} ${TEST_SHIM_CFLAGS} -I${NOTMUCH_SRCDIR}/test -I${NOTMUCH_SRCDIR}/lib -o ${shim_file} ${test_file} ${TEST_SHIM_LDFLAGS}
+}
+
+notmuch_with_shim () {
+ base_name="$1"
+ shift
+ shim_file="${base_name}.so"
+ LD_PRELOAD=./${shim_file}${LD_PRELOAD:+:$LD_PRELOAD} notmuch-shared "$@"
+}
# Creates a script that counts how much time it is executed and calls
# notmuch. $notmuch_counter_command is set to the path to the