diff options
| author | Glenn Morris | 2017-09-06 20:06:57 -0400 |
|---|---|---|
| committer | Glenn Morris | 2017-09-06 20:06:57 -0400 |
| commit | a0e3f715fc4882518fa737318c4d07ef7870bd90 (patch) | |
| tree | f659a37f2b2274ad9ed429da9935fc1b2923b686 /test/lib-src | |
| parent | 1436ce83d39112c44c434e95d6bd2e2320b5c73d (diff) | |
| download | emacs-a0e3f715fc4882518fa737318c4d07ef7870bd90.tar.gz emacs-a0e3f715fc4882518fa737318c4d07ef7870bd90.zip | |
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.
Diffstat (limited to 'test/lib-src')
| -rw-r--r-- | test/lib-src/emacsclient-tests.el | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/test/lib-src/emacsclient-tests.el b/test/lib-src/emacsclient-tests.el index 3a2396f7817..4b7fa47989d 100644 --- a/test/lib-src/emacsclient-tests.el +++ b/test/lib-src/emacsclient-tests.el | |||
| @@ -31,26 +31,29 @@ | |||
| 31 | "emacsclient") | 31 | "emacsclient") |
| 32 | "The emacsclient binary to test.") | 32 | "The emacsclient binary to test.") |
| 33 | 33 | ||
| 34 | (defun emacsclient-test-call-emacsclient () | 34 | (defmacro emacsclient-test-call-emacsclient (editor) |
| 35 | "Run emacsclient." | 35 | "Run emacsclient with ALTERNATE_EDITOR set to EDITOR." |
| 36 | (call-process emacsclient-test-emacs nil nil nil | 36 | `(let* ((process-environment |
| 37 | "--server-file" (expand-file-name "non-existent-file" invocation-directory) | 37 | (cons (concat "ALTERNATE_EDITOR=" ,editor) process-environment)) |
| 38 | "foo")) | 38 | (stat (call-process emacsclient-test-emacs nil nil nil |
| 39 | "--server-file" | ||
| 40 | (expand-file-name "non-existent-file" | ||
| 41 | invocation-directory) | ||
| 42 | "foo"))) | ||
| 43 | ;; Skip if emacsclient was compiled with -pg (bug#28319). | ||
| 44 | ;; Use ert--skip-unless rather than skip-unless to silence compiler. | ||
| 45 | (ert--skip-unless (not (and (stringp stat) | ||
| 46 | (string-match-p "rofiling" stat)))) | ||
| 47 | (should (eq 0 stat)))) | ||
| 39 | 48 | ||
| 40 | (ert-deftest emacsclient-test-alternate-editor-allows-arguments () | 49 | (ert-deftest emacsclient-test-alternate-editor-allows-arguments () |
| 41 | (let ((process-environment process-environment)) | 50 | (emacsclient-test-call-emacsclient |
| 42 | (setenv "ALTERNATE_EDITOR" (concat | 51 | (concat (expand-file-name invocation-name invocation-directory) " --batch"))) |
| 43 | (expand-file-name invocation-name invocation-directory) | ||
| 44 | " --batch")) | ||
| 45 | (should (eq 0 (emacsclient-test-call-emacsclient))))) | ||
| 46 | 52 | ||
| 47 | (ert-deftest emacsclient-test-alternate-editor-allows-quotes () | 53 | (ert-deftest emacsclient-test-alternate-editor-allows-quotes () |
| 48 | (let ((process-environment process-environment)) | 54 | (emacsclient-test-call-emacsclient |
| 49 | (setenv "ALTERNATE_EDITOR" (concat | 55 | (concat "\"" (expand-file-name invocation-name invocation-directory) |
| 50 | "\"" | 56 | "\"" " --batch"))) |
| 51 | (expand-file-name invocation-name invocation-directory) | ||
| 52 | "\"" " --batch")) | ||
| 53 | (should (eq 0 (emacsclient-test-call-emacsclient))))) | ||
| 54 | 57 | ||
| 55 | (provide 'emacsclient-tests) | 58 | (provide 'emacsclient-tests) |
| 56 | ;;; emacsclient-tests.el ends here | 59 | ;;; emacsclient-tests.el ends here |