]> git.eshelyaron.com Git - emacs.git/commitdiff
Stop emacsclient tests hanging (Bug#28319)
authorReuben Thomas <rrt@sc3d.org>
Fri, 1 Sep 2017 20:21:38 +0000 (21:21 +0100)
committerReuben Thomas <rrt@sc3d.org>
Fri, 1 Sep 2017 20:32:12 +0000 (21:32 +0100)
* test/lib-src/emacsclient-tests.el
(emacsclient-test-alternate-editor-allows-arguments): Use a
non-existent file to communicate with server, so that any existing
default server will not be hijacked (in fact, the test does
not need a server).
(emacsclient-test-alternate-editor-allows-quotes): Likewise.

test/lib-src/emacsclient-tests.el

index ea757f691447abcda94c7dcdb3902f56d594f572..e454e2825e6304ad4bb6af0a9b35af7300f3be32 100644 (file)
                                    "lib-src"))
   "Path to emacsclient binary in build tree.")
 
+(defun call-emacsclient ()
+  "Run emacsclient."
+  (call-process emacsclient-test-emacs nil nil nil
+                "--server-file" (expand-file-name "non-existent-file" invocation-directory)
+                "foo"))
+
 (ert-deftest emacsclient-test-alternate-editor-allows-arguments ()
   (let (process-environment process-environment)
     (setenv "ALTERNATE_EDITOR" (concat
                                 (expand-file-name invocation-name invocation-directory)
                                 " --batch"))
-    (should (= 0 (call-process emacsclient-test-emacs nil nil nil "foo")))))
+    (should (= 0 (call-emacsclient)))))
 
 (ert-deftest emacsclient-test-alternate-editor-allows-quotes ()
   (let (process-environment process-environment)
@@ -44,7 +50,7 @@
                                 "\""
                                 (expand-file-name invocation-name invocation-directory)
                                 "\"" " --batch"))
-    (should (= 0 (call-process emacsclient-test-emacs nil nil nil "foo")))))
+    (should (= 0 (call-emacsclient)))))
 
 (provide 'emacsclient-tests)
 ;;; emacsclient-tests.el ends here