From 206531674947789841a61bd428dd6babce933a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Mon, 30 Dec 2019 14:10:02 +0100 Subject: Make comint-tests more robust (bug#38813) * test/lisp/comint-tests.el (comint-test-no-password-function) (comint-test-password-function-with-value) (comint-test-password-function-with-nil): Call accept-process-output as many times as needed, with a slightly more generous timeout (100 ms), after sending the Password: prompt to the process, since there must be time for some back-and-forth communication. Also clear the process-query-on-exit flag, since it doesn't go well with noninteractive tests. --- test/lisp/comint-tests.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/lisp/comint-tests.el b/test/lisp/comint-tests.el index c04134599f6..4c1c5cc5e20 100644 --- a/test/lisp/comint-tests.el +++ b/test/lisp/comint-tests.el @@ -64,10 +64,10 @@ alter normal password flow." (with-temp-buffer (make-comint-in-buffer "test-comint-password" (current-buffer) cat) (let ((proc (get-buffer-process (current-buffer)))) + (set-process-query-on-exit-flag proc nil) (comint-send-string proc "Password: ") - (accept-process-output proc 0 1 t) (comint-send-eof) - (accept-process-output proc 0 1 t) + (while (accept-process-output proc 0.1 nil t)) (should (string-equal (buffer-substring-no-properties (point-min) (point-max)) "Password: PaSsWoRd123\n")) (when (process-live-p proc) @@ -87,10 +87,10 @@ flow. Hook function returns alternative password." (with-temp-buffer (make-comint-in-buffer "test-comint-password" (current-buffer) cat) (let ((proc (get-buffer-process (current-buffer)))) + (set-process-query-on-exit-flag proc nil) (comint-send-string proc "Password: ") - (accept-process-output proc 0 1 t) (comint-send-eof) - (accept-process-output proc 0 1 t) + (while (accept-process-output proc 0.1 nil t)) (should (string-equal (buffer-substring-no-properties (point-min) (point-max)) "Password: MaGiC-PaSsWoRd789\n")) (when (process-live-p proc) @@ -110,10 +110,10 @@ password flow if it returns a nil value." (with-temp-buffer (make-comint-in-buffer "test-comint-password" (current-buffer) cat) (let ((proc (get-buffer-process (current-buffer)))) + (set-process-query-on-exit-flag proc nil) (comint-send-string proc "Password: ") - (accept-process-output proc 0 1 t) (comint-send-eof) - (accept-process-output proc 0 1 t) + (while (accept-process-output proc 0.1 nil t)) (should (string-equal (buffer-substring-no-properties (point-min) (point-max)) "Password: PaSsWoRd456\n")) (when (process-live-p proc) -- cgit v1.2.1 From 957cdca6f0dd203547277ad1d11ecda9dce82b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Mon, 30 Dec 2019 15:40:13 +0100 Subject: Make minibuffer-tests work in out-of-tree builds (bug#38816) * test/lisp/minibuffer-tests.el (completion-table-test-quoting): Set default-directory. --- test/lisp/minibuffer-tests.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index 6b297244214..0605bad901a 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -82,7 +82,8 @@ (ert-deftest completion-table-test-quoting () (let ((process-environment - `("CTTQ1=ed" "CTTQ2=et/" ,@process-environment))) + `("CTTQ1=ed" "CTTQ2=et/" ,@process-environment)) + (default-directory (expand-file-name "test" source-directory))) (pcase-dolist (`(,input ,output) '( ;; Test that $ in files is properly $$ quoted. -- cgit v1.2.1 From 9b6872b4e4fa782d9df313ab771c23ad1e7f8eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Mon, 30 Dec 2019 15:24:13 +0100 Subject: ; * test/lisp/calc/calc-tests.el: Fix warnings --- test/lisp/calc/calc-tests.el | 1 + 1 file changed, 1 insertion(+) diff --git a/test/lisp/calc/calc-tests.el b/test/lisp/calc/calc-tests.el index 33e6b14827f..f85f8da5434 100644 --- a/test/lisp/calc/calc-tests.el +++ b/test/lisp/calc/calc-tests.el @@ -29,6 +29,7 @@ (require 'calc) (require 'calc-ext) (require 'calc-units) +(require 'calc-forms) ;; XXX The order in which calc libraries (in particular calc-units) ;; are loaded influences whether a calc integer in an expression -- cgit v1.2.1