Commit a0e3f715 authored by Glenn Morris's avatar Glenn Morris

Skip emacsclient tests if --enable-profiling was used

* test/lib-src/emacsclient-tests.el
(emacsclient-test-call-emacsclient): Make it a macro.
Handle "Profiling timer expired" return from emacsclient.  (Bug#28319)
(emacsclient-test-alternate-editor-allows-arguments)
(emacsclient-test-alternate-editor-allows-quotes): Update for above.
parent 1436ce83
...@@ -31,26 +31,29 @@ ...@@ -31,26 +31,29 @@
"emacsclient") "emacsclient")
"The emacsclient binary to test.") "The emacsclient binary to test.")
(defun emacsclient-test-call-emacsclient () (defmacro emacsclient-test-call-emacsclient (editor)
"Run emacsclient." "Run emacsclient with ALTERNATE_EDITOR set to EDITOR."
(call-process emacsclient-test-emacs nil nil nil `(let* ((process-environment
"--server-file" (expand-file-name "non-existent-file" invocation-directory) (cons (concat "ALTERNATE_EDITOR=" ,editor) process-environment))
"foo")) (stat (call-process emacsclient-test-emacs nil nil nil
"--server-file"
(expand-file-name "non-existent-file"
invocation-directory)
"foo")))
;; Skip if emacsclient was compiled with -pg (bug#28319).
;; Use ert--skip-unless rather than skip-unless to silence compiler.
(ert--skip-unless (not (and (stringp stat)
(string-match-p "rofiling" stat))))
(should (eq 0 stat))))
(ert-deftest emacsclient-test-alternate-editor-allows-arguments () (ert-deftest emacsclient-test-alternate-editor-allows-arguments ()
(let ((process-environment process-environment)) (emacsclient-test-call-emacsclient
(setenv "ALTERNATE_EDITOR" (concat (concat (expand-file-name invocation-name invocation-directory) " --batch")))
(expand-file-name invocation-name invocation-directory)
" --batch"))
(should (eq 0 (emacsclient-test-call-emacsclient)))))
(ert-deftest emacsclient-test-alternate-editor-allows-quotes () (ert-deftest emacsclient-test-alternate-editor-allows-quotes ()
(let ((process-environment process-environment)) (emacsclient-test-call-emacsclient
(setenv "ALTERNATE_EDITOR" (concat (concat "\"" (expand-file-name invocation-name invocation-directory)
"\"" "\"" " --batch")))
(expand-file-name invocation-name invocation-directory)
"\"" " --batch"))
(should (eq 0 (emacsclient-test-call-emacsclient)))))
(provide 'emacsclient-tests) (provide 'emacsclient-tests)
;;; emacsclient-tests.el ends here ;;; emacsclient-tests.el ends here
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment