diff options
| author | Noam Postavsky | 2018-02-02 18:12:00 -0500 |
|---|---|---|
| committer | Noam Postavsky | 2018-02-02 18:12:37 -0500 |
| commit | 2b288eb9006ed897e7323212408bd25b4bfe2230 (patch) | |
| tree | 841a0b11e1ba1a3139b52b30e1a21c76a73c0247 | |
| parent | d3090a3a3e22c4b0f4e0e833942f5942eb392c51 (diff) | |
| parent | 4c8157cfe06ef5715ba8533be164dd9a047711d0 (diff) | |
| download | emacs-2b288eb9006ed897e7323212408bd25b4bfe2230.tar.gz emacs-2b288eb9006ed897e7323212408bd25b4bfe2230.zip | |
; Merge from emacs-26
4c8157cfe0 ; Let files-tests.el pass multiple times in a session
99251ab62e ; Avoid process kill query during term tests
| -rw-r--r-- | test/lisp/files-tests.el | 22 | ||||
| -rw-r--r-- | test/lisp/term-tests.el | 22 |
2 files changed, 17 insertions, 27 deletions
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index 90e5ebf2153..5f42b904cca 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el | |||
| @@ -139,18 +139,16 @@ form.") | |||
| 139 | 139 | ||
| 140 | (ert-deftest files-test-local-variables () | 140 | (ert-deftest files-test-local-variables () |
| 141 | "Test the file-local variables implementation." | 141 | "Test the file-local variables implementation." |
| 142 | (unwind-protect | 142 | (cl-letf (((symbol-function 'hack-local-variables-confirm) |
| 143 | (progn | 143 | (lambda (&rest _) |
| 144 | (defadvice hack-local-variables-confirm (around files-test activate) | 144 | (setq files-test-result 'query) |
| 145 | (setq files-test-result 'query) | 145 | nil))) |
| 146 | nil) | 146 | (dolist (test files-test-local-variable-data) |
| 147 | (dolist (test files-test-local-variable-data) | 147 | (let ((str (concat "text\n\n;; Local Variables:\n;; " |
| 148 | (let ((str (concat "text\n\n;; Local Variables:\n;; " | 148 | (mapconcat 'identity (car test) "\n;; ") |
| 149 | (mapconcat 'identity (car test) "\n;; ") | 149 | "\n;; End:\n"))) |
| 150 | "\n;; End:\n"))) | 150 | (dolist (subtest (cdr test)) |
| 151 | (dolist (subtest (cdr test)) | 151 | (should (file-test--do-local-variables-test str subtest))))))) |
| 152 | (should (file-test--do-local-variables-test str subtest)))))) | ||
| 153 | (ad-disable-advice 'hack-local-variables-confirm 'around 'files-test))) | ||
| 154 | 152 | ||
| 155 | (defvar files-test-bug-18141-file | 153 | (defvar files-test-bug-18141-file |
| 156 | (expand-file-name "data/files-bug18141.el.gz" (getenv "EMACS_TEST_DIRECTORY")) | 154 | (expand-file-name "data/files-bug18141.el.gz" (getenv "EMACS_TEST_DIRECTORY")) |
diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el index 16466ea3cd4..234dfa1f0d5 100644 --- a/test/lisp/term-tests.el +++ b/test/lisp/term-tests.el | |||
| @@ -42,21 +42,13 @@ | |||
| 42 | ;; control chunking, and we don't have to worry about wrestling | 42 | ;; control chunking, and we don't have to worry about wrestling |
| 43 | ;; with stty settings. | 43 | ;; with stty settings. |
| 44 | (let ((proc (get-buffer-process (current-buffer)))) | 44 | (let ((proc (get-buffer-process (current-buffer)))) |
| 45 | (unwind-protect | 45 | ;; Don't get stuck when we close the buffer. |
| 46 | (prog2 (if (consp input) | 46 | (set-process-query-on-exit-flag proc nil) |
| 47 | (mapc (lambda (input) (term-emulate-terminal proc input)) input) | 47 | (if (consp input) |
| 48 | (term-emulate-terminal proc input)) | 48 | (mapc (lambda (input) (term-emulate-terminal proc input)) input) |
| 49 | (if return-var (buffer-local-value return-var (current-buffer)) | 49 | (term-emulate-terminal proc input)) |
| 50 | (buffer-substring-no-properties (point-min) (point-max))) | 50 | (if return-var (buffer-local-value return-var (current-buffer)) |
| 51 | ;; End the process to avoid query on buffer kill. | 51 | (buffer-substring-no-properties (point-min) (point-max)))))) |
| 52 | (process-send-eof proc) | ||
| 53 | (accept-process-output proc)) | ||
| 54 | ;; Make extra sure we don't get stuck in case we hit some | ||
| 55 | ;; error before sending eof. | ||
| 56 | (when (process-live-p proc) | ||
| 57 | (kill-process proc) | ||
| 58 | ;; Let Emacs update process status. | ||
| 59 | (accept-process-output proc)))))) | ||
| 60 | 52 | ||
| 61 | (ert-deftest term-simple-lines () | 53 | (ert-deftest term-simple-lines () |
| 62 | (let ((str "\ | 54 | (let ((str "\ |