diff options
| author | Eli Zaretskii | 2017-08-09 20:15:46 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-08-09 20:15:46 +0300 |
| commit | 7fc27ea70bc7dc24776b2c098ac970f2f21e37fb (patch) | |
| tree | 6506847574eda46651ac325d03a000fb80fd437c /test/src | |
| parent | da4438e14f1c55808937872b6d651a807404daa2 (diff) | |
| download | emacs-7fc27ea70bc7dc24776b2c098ac970f2f21e37fb.tar.gz emacs-7fc27ea70bc7dc24776b2c098ac970f2f21e37fb.zip | |
Fix crashing emacs-module tests on MS-Windows
* src/w32fns.c (syms_of_w32fns) <w32-disable-abort-dialog>: New
variable.
(emacs_abort): If w32-disable-abort-dialog is non-nil, abort right
away, without displaying the Abort dialog, which waits for the user.
* test/src/emacs-module-tests.el (module--test-assertion): Run the
inferior Emacs with the w32 abort dialog disabled. Expect the
status of the aborted Emacs sub-process to be 3 on MS-Windows and
2 on MS-DOS.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/emacs-module-tests.el | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index 2aa85f0b247..6a7ba5580da 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el | |||
| @@ -208,14 +208,22 @@ must evaluate to a regular expression string." | |||
| 208 | (with-temp-buffer | 208 | (with-temp-buffer |
| 209 | (let* ((default-directory tempdir) | 209 | (let* ((default-directory tempdir) |
| 210 | (status (call-process mod-test-emacs nil t nil | 210 | (status (call-process mod-test-emacs nil t nil |
| 211 | "-batch" "-Q" "-module-assertions" "-eval" | 211 | "-batch" "-Q" "-module-assertions" |
| 212 | "-eval" "(setq w32-disable-abort-dialog t)" | ||
| 213 | "-eval" | ||
| 212 | ,(prin1-to-string | 214 | ,(prin1-to-string |
| 213 | `(progn | 215 | `(progn |
| 214 | (require 'mod-test ,mod-test-file) | 216 | (require 'mod-test ,mod-test-file) |
| 215 | ,@body))))) | 217 | ,@body))))) |
| 216 | (should (stringp status)) | 218 | ;; Aborting doesn't raise a signal on MS-DOS/Windows, but |
| 217 | ;; eg "Aborted" or "Abort trap: 6" | 219 | ;; rather exits with a non-zero status: 2 on MS-DOS (see |
| 218 | (should (string-prefix-p "Abort" status)) | 220 | ;; msdos.c:msdos_abort), 3 on Windows, per MSDN documentation |
| 221 | ;; of 'abort'. | ||
| 222 | (if (memq system-type '(ms-dos windows-nt)) | ||
| 223 | (should (>= status 2)) | ||
| 224 | (should (stringp status)) | ||
| 225 | ;; eg "Aborted" or "Abort trap: 6" | ||
| 226 | (should (string-prefix-p "Abort" status))) | ||
| 219 | (search-backward "Emacs module assertion: ") | 227 | (search-backward "Emacs module assertion: ") |
| 220 | (goto-char (match-end 0)) | 228 | (goto-char (match-end 0)) |
| 221 | (should (string-match-p ,pattern | 229 | (should (string-match-p ,pattern |