aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/process-tests.el (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | Declare functions to silence byte-compilerStefan Kangas2021-12-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/auth-source.el (gnutls-symmetric-decrypt, gnutls-ciphers): * lisp/net/dbus.el (libxml-parse-xml-region): * lisp/simple.el (thread-name): * lisp/thread.el (thread-name, thread-signal, thread--blocker) (current-thread, thread-live-p, all-threads): * test/lisp/emacs-lisp/multisession-tests.el (sqlite-close): * test/lisp/net/gnutls-tests.el (gnutls-symmetric-decrypt) (gnutls-symmetric-encrypt, gnutls-hash-mac, gnutls-hash-digest) (gnutls-ciphers, gnutls-digests, gnutls-macs): * test/lisp/net/network-stream-tests.el (gnutls-peer-status): * test/lisp/net/shr-tests.el (libxml-parse-html-region): * test/src/decompress-tests.el (zlib-decompress-region): * test/src/process-tests.el (thread-last-error, thread-join) (make-thread): * test/src/xml-tests.el (libxml-parse-xml-region): Declare functions to silence byte-compiler in --without-all builds.
* | Tag a test from process-tests.el as :unstable on emba.Michael Albinus2021-11-251-0/+1
| | | | | | | | | | * test/src/process-tests.el (process-tests/multiple-threads-waiting): Tag it as :unstable on emba.
* | Prefer ert-with-temp-(directory|file) in most remaining testsStefan Kangas2021-11-081-18/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/auth-source-tests.el (auth-source-test-searches): * test/lisp/autorevert-tests.el (auto-revert-test00-auto-revert-mode) (auto-revert-test01-auto-revert-several-files) (auto-revert-test02-auto-revert-deleted-file) (auto-revert-test03-auto-revert-tail-mode) (auto-revert-test04-auto-revert-mode-dired) (auto-revert-test05-global-notify) (auto-revert-test06-write-file) (auto-revert-test07-auto-revert-several-buffers): * test/lisp/calendar/icalendar-tests.el (icalendar-tests--do-test-cycle): * test/lisp/custom-tests.el (custom-theme--load-path): * test/lisp/dired-aux-tests.el (dired-test-bug27496) (with-dired-bug28834-test): * test/lisp/emacs-lisp/bytecomp-tests.el (test-byte-comp-compile-and-load) (bytecomp-tests--dest-mountpoint) (bytecomp-tests--target-file-no-directory): * test/lisp/emacs-lisp/gv-tests.el (gv-tests--in-temp-dir): * test/lisp/eshell/eshell-tests.el (with-temp-eshell) (eshell-test-command-result): * test/lisp/info-xref-tests.el (info-xref-test-makeinfo): * test/lisp/vc/vc-tests.el (vc-test--create-repo) (vc-test--register, vc-test--state, vc-test--working-revision) (vc-test--checkout-model, vc-test--rename-file) (vc-test--version-diff): * test/src/buffer-tests.el (test-kill-buffer-auto-save-delete): * test/src/comp-tests.el (comp-tests-bootstrap): * test/src/process-tests.el (process-test-quoted-batfile): Prefer 'ert-with-temp-(directory|file)' to using 'make-temp-file' directly.
* | Replace some macros with ert-with-temp-(file|directory)Stefan Kangas2021-11-061-13/+2
|/ | | | | | | | | | | | * test/lisp/custom-tests.el (custom-tests--with-temp-dir): * test/lisp/files-tests.el (files-tests--with-temp-file): * test/lisp/progmodes/project-tests.el (project-tests--with-temporary-directory): * test/src/emacs-module-tests.el (module--with-temp-directory): * test/src/emacs-tests.el (emacs-tests--with-temp-file): * test/src/lread-tests.el (lread-tests--with-temp-file): * test/src/process-tests.el (process-tests--with-temp-directory): Replace macros with 'ert-with-temp-(file|directory)'. Update callers.
* New function num-processorsPaul Eggert2021-10-101-0/+6
| | | | | | | | | | | | | | | | | | | This addresses a FIXME comment in lisp/emacs-lisp/comp.el, relating to the number of subsidiary processes used by comp-run-async-workers in native compilation. * admin/merge-gnulib (GNULIB_MODULES): Add nproc. * doc/lispref/processes.texi (Process Information), etc/NEWS: Document num-processors. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib/nproc.c, lib/nproc.h, m4/nproc.m4: New files, copied from Gnulib by admin/merge-gnulib. * lisp/emacs-lisp/comp.el (w32-get-nproc): Remove decl. (comp-effective-async-max-jobs): Use num-processors. * src/process.c: Include nproc.h. (Fnum_processors): New function. (syms_of_process): Define ‘all’, ‘current’, ‘num-processors’. * src/w32proc.c (Fw32_get_nproc): Add FIXME comment. * test/src/process-tests.el (process-num-processors): New test.
* ; Minor stylistic checkdoc fixes in test/**/*.elStefan Kangas2021-09-261-1/+1
|
* Block TLS handshake until TCP connection establishedMattias Engdegård2021-07-131-0/+30
| | | | | | | | | | | | | | | | | | | If a TLS handshake is attempted before the completion of an asynchronous TCP connection has been ascertained, our local state will not be set up correctly for further progress and the sentinel "open" event will never be sent. This can occur if sufficient time passes after the initiation of an async TCP connection so that by the time `wait_reading_process_output` is called, the connection has already been established on the TCP level. This somewhat timing-sensitive bug has plagued HTTPS connections on some platforms, notably macOS, for a long time (bug#49449). * src/process.c (wait_reading_process_output): Gate the TLS handshake by the NON_BLOCKING_CONNECT_FD flag. The flag will be cleared as soon as the TCP socket is found to be writable. * test/src/process-tests.el (process-async-https-with-delay): New test.
* Skip a process test on Cygwin to avoid hangKen Brown2021-07-091-0/+2
| | | | | | | * test/src/process-tests.el (process-tests/fd-setsize-no-crash/make-network-process): Skip test on Cygwin to avoid hang due to connect/accept handshake. (Bug#49496)
* Remove unnecessary requires of rxStefan Kangas2021-03-221-1/+0
| | | | | * lisp/cedet/semantic/wisent/python.el (rx): * test/src/process-tests.el (rx): Remove unnecessary requires.
* Skip tests that require Internet when there's no InternetRobert Pluim2021-02-221-7/+15
| | | | | | | | | | | | | | | | | | | | | Bug#46641 The network-stream-tests actually work fine when the local machine has no IP at all, but cause a crash in the GnuTLS library when there is an IP configured but the interface is down. * test/lisp/net/network-stream-tests.el (internet-is-working): New defvar, checks if we can resolve "google.com". (connect-to-tls-ipv4-nowait, connect-to-tls-ipv6-nowait) (open-network-stream-tls-nowait, open-gnutls-stream-new-api-nowait) (open-gnutls-stream-old-api-nowait): Use it to check for working Internet access. * test/src/process-tests.el (internet-is-working): New defvar, checks if we can resolve "google.com". (lookup-family-specification, lookup-unicode-domains) (unibyte-domain-name, lookup-google, non-existent-lookup-failure): Use it to check for working Internet access.
* ; Fix byte-compilation warningEli Zaretskii2021-02-061-1/+1
| | | | | * test/src/process-tests.el (process-sentinel-interrupt-event): Fix byte compilation warning.
* ; Fix last changeEli Zaretskii2021-02-061-2/+1
|
* New test for src/process.c on MS-WindowsIoannis Kappas2021-02-061-0/+29
| | | | | | | * test/src/process-tests.el (process-sentinel-interrupt-event): New test. (Bug#46284) Copyright-paperwork-exempt: yes
* Add more assertions to recently-added process test.Philipp Stephani2021-01-241-1/+2
| | | | | | * test/src/process-tests.el (process-tests/multiple-threads-waiting): Also check that 'thread-join' and 'thread-last-error' return the expected errors.
* Add a unit test testing interaction between threads and processes.Philipp Stephani2021-01-231-0/+29
| | | | | | | | This unit test tests that we can call 'accept-process-output' in parallel from multiple threads. * test/src/process-tests.el (process-tests/multiple-threads-waiting): New unit test.
* Replace Unix commands with Emacs in process tests.Philipp Stephani2021-01-181-9/+71
| | | | | | | | | | | | That way, the tests only depend on Emacs, and not on utilities that might not be available during test time. * test/src/process-tests.el (process-tests--eval) (process-tests--emacs-command, process-tests--emacs-binary) (process-tests--dump-file) (process-tests--usable-file-for-reinvoke): New helper functions. (process-tests/sentinel-called) (process-tests/sentinel-with-multiple-processes): Use them.
* Ensure that sentinels are called during 'accept-process-output'.Philipp Stephani2021-01-171-0/+53
| | | | | | | | | | | | When we're trying to notify a process about a status change, we need to ignore the SIGCHLD pipe temporarily, otherwise the code would likely not run into the timeout case that's necessary for a status change to happen. * src/process.c (wait_reading_process_output): Ignore the SIGCHLD pipe when notifying a process about a status change. * test/src/process-tests.el (process-tests/sentinel-called) (process-tests/sentinel-with-multiple-processes): New unit tests.
* Fix deadlock when receiving SIGCHLD during 'pselect'.Philipp Stephani2021-01-161-5/+0
| | | | | | | | | | | | | | | | | | | | | | If we receive and handle a SIGCHLD signal for a process while waiting for that process, 'pselect' might never return. Instead, we have to explicitly 'pselect' that the process status has changed. We do this by writing to a pipe in the SIGCHLD handler and having 'wait_reading_process_output' select on it. * src/process.c (child_signal_init): New helper function to create a pipe for SIGCHLD notifications. (child_signal_read, child_signal_notify): New helper functions to read from/write to the child signal pipe. (create_process): Initialize the child signal pipe on first use. (handle_child_signal): Notify waiters that a process status has changed. (wait_reading_process_output): Make sure that we also catch SIGCHLD/process status changes. * test/src/process-tests.el (process-tests/fd-setsize-no-crash/make-process): Remove workaround, which is no longer needed.
* Only run IPv6 tests if we have an IPv6 addressRobert Pluim2021-01-121-5/+16
| | | | | | | | | | | | | | * test/src/process-tests.el (ipv6-is-available): New function for checking whether we have a globally routable IPv6 prefix assigned. (lookup-family-specification): Use 'ipv6-is-available' to check for IPv6. Use 'localhost' instead of 'google.com' to test 'network-lookup-address-info' API. (lookup-google): Use 'ipv6-is-available' to check for IPv6. * test/lisp/net/nsm-tests.el (nsm-ipv6-is-available): Rename to 'ipv6-is-available', make identical to the one in test/src/process-tests.el.
* Increase probability that a process test succeeds.Philipp Stephani2021-01-101-0/+5
| | | | | | * test/src/process-tests.el (process-tests/fd-setsize-no-crash/make-process): Work around potential Emacs bug.
* Fix process-tests on MS-WindowsEli Zaretskii2021-01-051-0/+11
| | | | | | | It was again broken by recent changes. * test/src/process-tests.el (process-tests/fd-setsize-no-crash/make-serial-process): Skip test on MS-Windows.
* Make a process tests a bit more robust.Philipp Stephani2021-01-041-2/+5
| | | | | | * test/src/process-tests.el (process-tests/fd-setsize-no-crash/make-process): Allow for processes to fail before 'exec'.
* Make a process test faster.Philipp Stephani2021-01-021-3/+5
| | | | | | | | | | | | The test 'process-tests/fd-setsize-no-crash/make-process' used to call 'sleep' to ensure that enough processes are live to trigger a FD_SETSIZE overflow. However, we can just call 'cat' instead and close standard input when done. That way, we only wait as long as needed. * process-tests.el (process-tests/fd-setsize-no-crash/make-process): Invoke 'cat' instead of 'sleep'. Close standard input to exit the 'cat' processes.
* Simplify TTY allocation.Philipp Stephani2021-01-021-59/+12
| | | | | | | | | | | | The 'process-tty-name' already provides the TTY name, we don't have interrogate the TTY host. * test/src/process-tests.el (process-tests/fd-setsize-no-crash/make-serial-process): Use 'process-tty-name' instead of having the TTY host print its TTY name. Check whether TTY names are unique. (process-tests--new-pty, process-tests--with-temp-file): Remove; no longer used.
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Fix process-tests on MS-WindowsEli Zaretskii2020-12-311-0/+7
| | | | | * test/src/process-tests.el (process-tests--fd-setsize-test): On MS-Windows start the pipe processes in the "stopped" condition.
* * test/src/process-tests.el: Let timeouts fail the tests. Fix some docstringsMichael Albinus2020-12-311-26/+26
|
* Unbreak process tests if 'errno' is not installed.Philipp Stephani2020-12-311-1/+3
| | | | | * test/src/process-tests.el (process-tests--EMFILE-message): Don't signal an error if the 'errno' binary is unavailable.
* Manually limit file descriptors that we select on to FD_SETSIZE.Philipp Stephani2020-12-311-29/+71
| | | | | | | | | | | | | | | | | | This works even if another thread or process resets the resource limit for open file descriptors, e.g., using 'prlimit' on GNU/Linux. * src/process.c (create_process, create_pty, Fmake_pipe_process) (Fmake_serial_process, connect_network_socket) (server_accept_connection): Limit file descriptors to FD_SETSIZE. * test/src/process-tests.el (process-tests--with-raised-rlimit): New helper macro. (process-tests--fd-setsize-test): Rename from 'process-tests--with-many-pipes'. Increase resource limit during test if possible. (process-tests/fd-setsize-no-crash/make-process) (process-tests/fd-setsize-no-crash/make-pipe-process) (process-tests/fd-setsize-no-crash/make-network-process) (process-tests--new-pty): Rename callers.
* Fix a potential unit test breakage on GNU/Linux.Philipp Stephani2020-12-311-1/+8
| | | | | | * test/src/process-tests.el (process-tests/fd-setsize-no-crash/make-process): Allow special exit codes that can happen if terminal setup fails in the child process.
* Fix an incorrect Edebug specification.Philipp Stephani2020-12-301-1/+1
| | | | | * test/src/process-tests.el (process-tests--with-many-pipes): Fix incorrect Edebug specification.
* Extend and overhaul FD_SETSIZE overflow tests.Philipp Stephani2020-12-301-35/+307
| | | | | | | | | | | | | | | | | | | | | | | | Instead of trying to generate the right number of processes, pre-create lots of unused pipe processes until creation fails. Extend the tests to the 'pty' connection type and other kinds of process objects. * test/src/process-tests.el (process-tests--ignore-EMFILE) (process-tests--with-buffers, process-tests--with-processes) (process-tests--with-many-pipes, process-tests--with-temp-file) (process-tests--with-temp-directory): New helper macros. (process-tests/fd-setsize-no-crash/make-process): Renamed from 'process-tests/fd-setsize-no-crash'. Fail on timeout. Also test the 'pty' connection type. Pre-create lots of pipe processes so we reach the FD_SETSIZE limit faster. Ignore EMFILE more precisely, if possible. (process-tests/fd-setsize-no-crash/make-pipe-process) (process-tests/fd-setsize-no-crash/make-network-process) (process-tests/fd-setsize-no-crash/make-serial-process): New tests that test FD_SETSIZE limits for other kinds of processes. (process-tests--EMFILE-message): New helper function and cache variable. (process-tests--new-pty): New helper function.
* ; * test/src/process-tests.el: Fix comment style.Philipp Stephani2020-12-301-1/+1
|
* A better fix for process-tests on MS-WindowsEli Zaretskii2020-12-291-2/+3
| | | | | | | | | * src/w32.c (pipe2): When forcibly closing pipe handles due to overflow of FD_SETSIZE, set the handles to -1, to avoid assertion violations in emacs_close. * test/src/process-tests.el (process-tests/fd-setsize-no-crash): No need to skip this test anymore.
* Fix process-tests on MS-WindowsEli Zaretskii2020-12-291-0/+1
| | | | | | * test/src/process-tests.el (process-tests/fd-setsize-no-crash): Skip this test on windows-nt systems, as we cannot use more than FD_SETSIZE file descriptors there: if we try, we crash.
* Instrument process-tests.el for timeouts on embaMichael Albinus2020-12-291-19/+38
|
* Add a regression test for Bug#24325.Philipp Stephani2020-12-291-0/+35
| | | | | * test/src/process-tests.el (process-tests/fd-setsize-no-crash): New unit test.
* ; Fix license statements.Stefan Kangas2020-08-271-3/+5
|
* Use lexical-binding in most src testsStefan Kangas2020-04-241-7/+7
| | | | | | | | | | | | | | | | | | | | * test/src/charset-tests.el: * test/src/chartab-tests.el: * test/src/cmds-tests.el: * test/src/coding-tests.el (top-level) (generate-ascii-file, generate-mostly-nonascii-file): * test/src/doc-tests.el: * test/src/floatfns-tests.el: * test/src/font-tests.el: * test/src/keymap-tests.el: * test/src/process-tests.el (top-level) (process-test-sentinel-wait-function-working-p) (process-test-stderr-buffer, process-test-stderr-filter): * test/src/textprop-tests.el: * test/src/thread-tests.el: * test/src/timefns-tests.el: * test/src/undo-tests.el: * test/src/xml-tests.el: Use lexical-binding.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Ensure building and running on non-IPv6 capable hosts worksRobert Pluim2019-11-081-5/+6
| | | | | | | | | | | * src/process.c (Fmake_network_process) [AF_INET6]: Only build ::1 localhost when IPv6 is supported. (Fnetwork_lookup_address_info) [AF_INET6]: Move check for Qipv6 inside ifdef, since its definition depends on AF_INET6. Don't return IPv6 addresses when they're not supported. * test/src/process-tests.el (lookup-family-specification, lookup-google): Only do IPv6 lookup if IPv6 is supported.
* Fix non-deterministic process testNoam Postavsky2019-08-241-10/+16
| | | | | | * test/src/process-tests.el (set-process-filter-t): Don't assume subprocess output will come in a single chunk, keep waiting for more data until next "prompt" is read from subprocess.
* Fix DNS testsRobert Pluim2019-08-241-5/+13
| | | | | | | * test/src/process-tests.el: (lookup-family-specification, lookup-unicode-domains, unibyte-domain-name, lookup-google, non-existent-lookup-failure): Skip on Hydra, which doesn't have DNS. Fix buggy test condition. (Bug#37165)
* Merge remote-tracking branch 'origin/netsec'Lars Ingebrigtsen2019-08-231-0/+29
|\
| * Don't check unibyte hostnames for pure-ASCIIRobert Pluim2018-07-171-0/+4
| | | | | | | | | | | | | | | | * src/process.c (network_lookup_address_info_1): Only check multibyte hostnames for pure-ASCII. * test/src/process-tests.el (unibyte-domain-name): Test unibyte domain names with network-lookup-address-info.
| * Add tests for network-lookup-address-infoRobert Pluim2018-07-171-0/+25
| | | | | | | | | | | | | | | | | | * test/src/process-tests.el (lookup-family-specification): Test network-lookup-address-info api. (lookup-unicode-domains): Test that unicode domains fail. (lookup-google): Test that normal lookups succeed. (non-existent-lookup-failure): Check that known non-existent domains fail.
* | Merge from origin/emacs-26Glenn Morris2019-07-301-0/+29
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8fbe462 (origin/emacs-26) ; * doc/lispref/positions.texi (List Motion... 1d9efc0 Add index for "\( in strings" (Bug#25195) 304e96f Fix doc-string of 'fit-window-to-buffer' (Bug#36848) d4c4987 Update view-mode docstring d6ca1fc ; * lisp/term.el: Add missing / to esc seq commentary. b3e2073 Fix subproc listening when setting filter to non-t (Bug#36591) f671950 * etc/NEWS.25: Belatedly announce rcirc-reconnect-delay. 7f42277 Mention term.el's \032 dir tracking in commentary (Bug#19524) 16a529e Remove upload functionality of package-x from the elisp manual 78e6c2a * etc/AUTHORS: Update. 086a56e Clarify Gravatar docs 0592467 * doc/lispref/display.texi (Defining Faces): Say a face can't... # Conflicts: # doc/emacs/programs.texi # etc/AUTHORS # lisp/term.el
| * | Fix subproc listening when setting filter to non-t (Bug#36591)Noam Postavsky2019-07-251-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/process.c (Fset_process_filter): Call add_process_read_fd according to the state of process filter before it's updated. This restores the correct functioning as it was before 2016-02-16 "Allow setting the filter masks later". Inline the set_process_filter_masks call instead of fixing it that function, because it is also called from connect_network_socket, and we don't want to change the behavior of that function so close to release. * test/src/process-tests.el (set-process-filter-t): New test.