diff options
| author | Eli Zaretskii | 2020-03-27 15:43:20 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2020-03-27 16:19:20 +0300 |
| commit | f98ee21c0e3d4e00569fdd9f2671fd8394ab8a65 (patch) | |
| tree | 2fbc74b9c43d67ecd1c6fcb5f46841578248d3b5 /test/src | |
| parent | e4f8098b9e6e1a0b310cb64f73d39d2b0d3d9f2f (diff) | |
| download | emacs-f98ee21c0e3d4e00569fdd9f2671fd8394ab8a65.tar.gz emacs-f98ee21c0e3d4e00569fdd9f2671fd8394ab8a65.zip | |
Port the 'module/async-pipe' test to MS-Windows
These changes let the code compile and produce a valid DLL, but the
test hangs. It looks like the hang is in Fdelete_process, when it
closes one of the descriptors of the pipe process.
In addition, this use of the pipe process cannot currently work
on MS-Windows, since make-pipe-process doesn't set up the reader
thread to read from the Emacs's side of the pipe, so the select
emulation doesn't know there's stuff to read from that pipe.
* test/data/emacs-module/mod-test.c [WINDOWSNT]: Include
windows.h.
(ALIGN_STACK) [!__x86_64__]: Define for 32-bit builds.
(sleep_for_half_second): New function.
(write_to_pipe): Declare return type differently for WINDOWSNT.
Call sleep_for_half_second.
(Fmod_test_async_pipe) [WINDOWSNT]: Use _beginthread as substitute
for pthread_create.
(invalid_finalizer): Replace non_ASCII character in a comment.
* test/src/emacs-module-tests.el (module/async-pipe): Skip on
MS-Windows, as the test fails and then hangs.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/emacs-module-tests.el | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index 1f91795e1e6..6851b890451 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el | |||
| @@ -426,6 +426,7 @@ See Bug#36226." | |||
| 426 | 426 | ||
| 427 | (ert-deftest module/async-pipe () | 427 | (ert-deftest module/async-pipe () |
| 428 | "Check that writing data from another thread works." | 428 | "Check that writing data from another thread works." |
| 429 | (skip-unless (not (eq system-type 'windows-nt))) ; FIXME! | ||
| 429 | (with-temp-buffer | 430 | (with-temp-buffer |
| 430 | (let ((process (make-pipe-process :name "module/async-pipe" | 431 | (let ((process (make-pipe-process :name "module/async-pipe" |
| 431 | :buffer (current-buffer) | 432 | :buffer (current-buffer) |
| @@ -435,6 +436,8 @@ See Bug#36226." | |||
| 435 | (progn | 436 | (progn |
| 436 | (mod-test-async-pipe process) | 437 | (mod-test-async-pipe process) |
| 437 | (should (accept-process-output process 1)) | 438 | (should (accept-process-output process 1)) |
| 439 | ;; The string below must be identical to what | ||
| 440 | ;; mod-test.c:write_to_pipe produces. | ||
| 438 | (should (equal (buffer-string) "data from thread"))) | 441 | (should (equal (buffer-string) "data from thread"))) |
| 439 | (delete-process process))))) | 442 | (delete-process process))))) |
| 440 | 443 | ||