aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/process-tests.el (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* | | Remove :stop key from make-process.Philipp Stephani2019-04-191-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has never worked and caused issues such as Bug#30460. * src/process.c (Fmake_process): Don't accept :stop key any more. (syms_of_process): Define needed symbol 'null'. * test/src/process-tests.el (make-process/stop): New unit test. * doc/lispref/processes.texi (Asynchronous Processes): Remove :stop key from manual.
* | | Let debugger handle process spawn errors on w32 (Bug#33016)Noam Postavsky2019-04-141-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since child_setup() is called between block_input()...unblock_input(), when an error is signaled the Lisp debugger is prevented from starting. Therefore, let the callers signal the error instead (which they already do for non-w32 platforms, just the error message needs an update). * src/callproc.c (child_setup) [WINDOWSNT]: Don't call report_file_error here. (call_process) [WINDOWNT]: * src/process.c (create_process) [WINDOWSNT]: Call report_file_errno here instead, after the unblock_input() call, same as for !WINDOWSNT. * src/lisp.h (CHILD_SETUP_ERROR_DESC): New preprocessor define. Flip the containing ifndef DOS_NT branches so that it's ifdef DOS_NT. * src/eval.c (when_entered_debugger): Remove. (syms_of_eval) <internal-when-entered-debugger>: Define it as a Lisp integer variable instead. (maybe_call_debugger): Update comment. * test/src/process-tests.el (make-process-w32-debug-spawn-error): * test/src/callproc-tests.el (call-process-w32-debug-spawn-error): New tests.
* | | Fix accept-process-output/process-live-p confusionPaul Eggert2019-01-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/processes.texi (Accepting Output): Document the issue. * lisp/net/tramp-adb.el (tramp-adb-parse-device-names): * lisp/net/tramp-rclone.el (tramp-rclone-parse-device-names): * lisp/net/tramp-smb.el (tramp-smb-wait-for-output): * lisp/net/tramp.el (tramp-interrupt-process): * test/src/process-tests.el (make-process/mix-stderr): Fix code that uses accept-process-output and process-live-p. Add FIXME comments as necessary. * lisp/net/tramp-sudoedit.el (tramp-sudoedit-action-sudo): * lisp/net/tramp.el (tramp-action-out-of-band): Add FIXME comments as necessary.
* | | Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\ \ \ | |/ / | | | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * | Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | | | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* | | Handle `make-process' in Tramp and ange-ftpMichael Albinus2018-12-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/processes.texi (Asynchronous Processes): Explain, that not all file name handlers support `make-process'. * lisp/net/ange-ftp.el: * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): * lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist): * lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist): * lisp/net/tramp.el (tramp-file-name-for-operation): Add `make-process'. * lisp/vc/ediff-util.el: * src/process.c: * test/src/process-tests.el: Use "file name handler" consequently.
* | | Add file name handler support for 'make-process' (Bug#28691)Philipp Stephani2018-12-221-0/+49
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/process.c (Fmake_process): Add new keyword argument ':file-handler'. (syms_of_process) <make-process, :file-handler>: Define new symbols. * lisp/files.el (file-name-non-special): Add support for 'make-process'. * test/src/process-tests.el (make-process/file-handler/found) (make-process/file-handler/not-found) (make-process/file-handler/disable): New unit tests. (process-tests--file-handler): New helper function. * test/lisp/files-tests.el (files-tests-file-name-non-special-make-process): New unit test. * doc/lispref/files.texi (Magic File Names): Document that 'make-process' can invoke file name handlers. * doc/lispref/processes.texi (Asynchronous Processes): Document ':file-handlers' argument to 'make-process'. * etc/NEWS (Lisp Changes in Emacs 27.1): Mention new :file-handler argument for 'make-process'.
* | Don’t assume ordering in make-process/mix-stderrPaul Eggert2018-05-211-1/+14
| | | | | | | | | | | | | | * test/src/process-tests.el (process-tests--mixable): New function. (make-process/mix-stderr): Don’t assume stdout is merged before stderr. POSIX does not require this, and the assumption failed to hold on my Fedora 28 platform. See Bug#31214.
* | * test/src/process-tests.el (make-process/mix-stderr): Skip on hydra.Glenn Morris2018-04-301-0/+3
| |
* | * test/src/process-tests.el (make-process/mix-stderr): Use bash.Glenn Morris2018-04-181-3/+3
| | | | | | | | Not all shells support ">&2".