diff options
author | Dmitry Kurochkin <dmitry.kurochkin@gmail.com> | 2012-01-29 07:36:02 +0400 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-02-12 11:58:20 -0500 |
commit | 754ddbb578175b986b10099cb4a11517080579f7 (patch) | |
tree | 52d3f70720a3bba413dccd7fa0df014dbc410a0d /test | |
parent | 022a2810809ffba4a7bcb71ed3483d2cb29d1c77 (diff) |
test: auto load elisp tests file in test_emacs if available
This allows us to simplify shell part of tests written in elisp.
Diffstat (limited to 'test')
-rw-r--r-- | test/test-lib.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/test-lib.sh b/test/test-lib.sh index 81583284..0174e93f 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -943,6 +943,12 @@ test_emacs () { test -z "$missing_dependencies" || return if [ -z "$EMACS_SERVER" ]; then + emacs_tests="$(basename $0).el" + if [ -f "$TEST_DIRECTORY/$emacs_tests" ]; then + load_emacs_tests="--eval '(load \"$emacs_tests\")'" + else + load_emacs_tests= + fi server_name="notmuch-test-suite-$$" # start a detached session with an emacs server # user's TERM is given to dtach which assumes a minimally @@ -950,6 +956,7 @@ test_emacs () { TERM=$ORIGINAL_TERM dtach -n "$TEST_TMPDIR/emacs-dtach-socket.$$" \ sh -c "stty rows 24 cols 80; exec '$TMP_DIRECTORY/run_emacs' \ --no-window-system \ + $load_emacs_tests \ --eval '(setq server-name \"$server_name\")' \ --eval '(server-start)' \ --eval '(orphan-watchdog $$)'" || return |