mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-03-14 03:25:15 +01:00
test: run emacs inside screen
Before the change, emacs run in daemon mode without any visible buffers. Turns out that this affects emacs behavior in some cases. In particular, `window-end' function returns `point-max' instead of the last visible position. That makes it hard or impossible to implement some tests. The patch runs emacs in a detached screen(1) session. So that it works exactly as if it has a visible window. Note: screen terminates when emacs exits. So the patch does not introduce new "running processes left behind" issues.
This commit is contained in:
parent
749abb74f2
commit
a1ea4e914f
1 changed files with 8 additions and 2 deletions
|
@ -841,10 +841,16 @@ EOF
|
|||
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 $@)"
|
||||
|
|
Loading…
Add table
Reference in a new issue