all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jim Porter <jporterbugs@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 62578@debbugs.gnu.org
Subject: bug#62578: 30.0.50; [PATCH] Add regression tests for synchronous processes in Eshell
Date: Sat, 1 Apr 2023 00:16:38 -0700	[thread overview]
Message-ID: <f2ba59be-61fe-d253-f560-6cb74f7f688a@gmail.com> (raw)
In-Reply-To: <83355k16gr.fsf@gnu.org>

On 3/31/2023 11:07 PM, Eli Zaretskii wrote:
>> Date: Fri, 31 Mar 2023 21:41:09 -0700
>> From: Jim Porter <jporterbugs@gmail.com>
>>
>> +(ert-deftest esh-proc-test/synchronous-proc/simple/interactive ()
>> +  "Test that synchronous processes work in an interactive shell."
>> +  (skip-unless (executable-find "echo"))
> 
> This will always skip on MS-DOS, since "echo" is not available as an
> external program OOTB, only if GNU Coreutils are installed.  And even
> if Coreutils _are_ installed, a command that invokes "echo" will most
> probably invoke the shell builtin instead.

My main goal here is to test synchronous subprocesses on platforms 
*other than* MS-DOS, since these new tests aren't really necessary on 
MS-DOS itself: there are plenty of existing Eshell tests that create 
processes, and they'd *all* use synchronous subprocesses on MS-DOS.

As for calling a shell builtin, Eshell should translate "*echo" to 
"/path/to/echo" (or "C:/path/to/echo.exe") before calling it, so it 
shouldn't use a shell builtin here. You're right though that the tests 
probably require GNU Coreutils to be installed (this is also true of 
quite a few existing Eshell tests though).

>> +  (skip-unless (and (executable-find "echo")
>> +                    (executable-find "rev")))
> 
> Likewise here: "rev" is not expected to be available on MS-DOS.

To make this work in more places, I could switch "rev" to something 
that's actually in GNU Coreutils. Maybe "wc".

> I think you need to rethink these tests in a way that uses different
> commands.  My suggestion is to use the Emacs executable, since that is
> always available when running these tests.

Since these tests are meant to check the "synchronous subprocess" code 
in Eshell on non-MS-DOS platforms, I'd say it's ok. However, I can 
change my patch if you prefer. I could either:

1) Add a comment to the tests explaining that they're just meant to 
simulate some of MS-DOS's limitations on non-MS-DOS systems, or

2) Rework these tests so they work the same on both MS-DOS and other 
systems.

Personally, I lean softly towards (1), partly because the Eshell test 
suite probably breaks in quite a few other places on MS-DOS anyway. 
However, it shouldn't be too hard to do (2) instead.

What do you think?





  reply	other threads:[~2023-04-01  7:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-01  4:41 bug#62578: 30.0.50; [PATCH] Add regression tests for synchronous processes in Eshell Jim Porter
2023-04-01  6:07 ` Eli Zaretskii
2023-04-01  7:16   ` Jim Porter [this message]
2023-04-01  7:22     ` Eli Zaretskii
2023-04-01  7:40       ` Jim Porter
2023-04-02  0:58         ` Jim Porter
2023-04-02  5:29           ` Eli Zaretskii
2023-04-02  5:51             ` Jim Porter
2023-04-02 21:25               ` Jim Porter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f2ba59be-61fe-d253-f560-6cb74f7f688a@gmail.com \
    --to=jporterbugs@gmail.com \
    --cc=62578@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.