TERM=dumb
export LANG LC_ALL PAGER TERM TZ
GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}
+export SCREENRC=/dev/null
+export SYSSCREENRC=/dev/null
# Protect ourselves from common misconfiguration to export
# CDPATH into the environment
fi
}
+# Like test_expect_equal, but takes two filenames.
test_expect_equal_file ()
{
exec 1>&6 2>&7 # Restore stdout and stderr
fi
}
-# This is not among top-level (test_expect_success | test_expect_failure)
+# This is not among top-level (test_expect_success)
# but is a prefix that can be used in the test script, like:
#
# test_expect_success 'complain and die' '
test_emacs () {
if [ -z "$EMACS_SERVER" ]; then
EMACS_SERVER="notmuch-test-suite-$$"
- "$TMP_DIRECTORY/run_emacs" \
- --daemon \
+ # start a detached screen session with an emacs server
+ screen -S "$EMACS_SERVER" -d -m "$TMP_DIRECTORY/run_emacs" \
+ --no-window-system \
--eval "(setq server-name \"$EMACS_SERVER\")" \
+ --eval '(server-start)' \
--eval "(orphan-watchdog $$)" || return
+ # wait until the emacs server is up
+ until test_emacs '()' 2>/dev/null; do
+ sleep 1
+ done
fi
emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)"