diff options
| -rw-r--r-- | src/w32fns.c | 8 | ||||
| -rw-r--r-- | test/src/emacs-module-tests.el | 16 |
2 files changed, 20 insertions, 4 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 457599fce0e..bf3c1d5d303 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -10708,6 +10708,11 @@ default value t means to add the width of one canonical character of the | |||
| 10708 | tip frame. */); | 10708 | tip frame. */); |
| 10709 | Vw32_tooltip_extra_pixels = Qt; | 10709 | Vw32_tooltip_extra_pixels = Qt; |
| 10710 | 10710 | ||
| 10711 | DEFVAR_BOOL ("w32-disable-abort-dialog", | ||
| 10712 | w32_disable_abort_dialog, | ||
| 10713 | doc: /* Non-nil means don't display the abort dialog when aborting. */); | ||
| 10714 | w32_disable_abort_dialog = 0; | ||
| 10715 | |||
| 10711 | #if 0 /* TODO: Port to W32 */ | 10716 | #if 0 /* TODO: Port to W32 */ |
| 10712 | defsubr (&Sx_change_window_property); | 10717 | defsubr (&Sx_change_window_property); |
| 10713 | defsubr (&Sx_delete_window_property); | 10718 | defsubr (&Sx_delete_window_property); |
| @@ -10902,6 +10907,9 @@ w32_backtrace (void **buffer, int limit) | |||
| 10902 | void | 10907 | void |
| 10903 | emacs_abort (void) | 10908 | emacs_abort (void) |
| 10904 | { | 10909 | { |
| 10910 | if (w32_disable_abort_dialog) | ||
| 10911 | abort (); | ||
| 10912 | |||
| 10905 | int button; | 10913 | int button; |
| 10906 | button = MessageBox (NULL, | 10914 | button = MessageBox (NULL, |
| 10907 | "A fatal error has occurred!\n\n" | 10915 | "A fatal error has occurred!\n\n" |
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 |