unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 70196@debbugs.gnu.org
Subject: bug#70196: 30.0.50; sh-script-tests fails
Date: Thu, 04 Apr 2024 18:46:57 +0300	[thread overview]
Message-ID: <864jch6sge.fsf@gnu.org> (raw)
In-Reply-To: <878r1t188x.fsf@gmx.de> (message from Michael Albinus on Thu, 04 Apr 2024 17:02:22 +0200)

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: 70196@debbugs.gnu.org
> Date: Thu, 04 Apr 2024 17:02:22 +0200
> 
> The following works for me w/o problems:
> 
> --8<---------------cut here---------------start------------->8---
> # bash -ic "make -C test sh-script-tests"
> --8<---------------cut here---------------end--------------->8---
> 
> And the following shows the errors:
> 
> --8<---------------cut here---------------start------------->8---
> # tcsh -ic "make -C test sh-script-tests"
> --8<---------------cut here---------------end--------------->8---
> 
> So I guess one must check the used shell, when starting the tests.

Thanks, does the below fix the problem?

diff --git a/test/lisp/progmodes/sh-script-tests.el b/test/lisp/progmodes/sh-script-tests.el
index e73d523..3f810e8 100644
--- a/test/lisp/progmodes/sh-script-tests.el
+++ b/test/lisp/progmodes/sh-script-tests.el
@@ -25,11 +25,15 @@
 (require 'ert)
 (require 'ert-x)
 
+(defun sh-script-tests-shell-script-mode ()
+  (sh-set-shell "/bin/sh")
+  (shell-script-mode))
+
 (ert-deftest test-sh-script-indentation ()
   (with-temp-buffer
     (insert "relative-path/to/configure --prefix=$prefix\\
              --with-x")
-    (shell-script-mode)
+    (sh-script-tests-shell-script-mode)
     (goto-char (point-min))
     (forward-line 1)
     (indent-for-tab-command)
@@ -41,7 +45,7 @@ test-sh-script-indentation
 (ert-deftest test-basic-sh-indentation ()
   (with-temp-buffer
     (insert "myecho () {\necho foo\n}\n")
-    (shell-script-mode)
+    (sh-script-tests-shell-script-mode)
     (indent-region (point-min) (point-max))
     (should (equal (buffer-string)
   "myecho () {
@@ -55,7 +59,7 @@ test-indentation
 (ert-deftest test-indent-after-continuation ()
   (with-temp-buffer
     (insert "for f \\\nin a; do \\\ntoto; \\\ndone\n")
-    (shell-script-mode)
+    (sh-script-tests-shell-script-mode)
     (let ((sh-indent-for-continuation '++))
       (let ((sh-indent-after-continuation t))
         (indent-region (point-min) (point-max))
@@ -72,7 +76,7 @@ test-indent-after-continuation
 
 (defun test-sh-back (string &optional pos)
   (with-temp-buffer
-    (shell-script-mode)
+    (sh-script-tests-shell-script-mode)
     (insert string)
     (sh-smie--default-backward-token)
     (= (point) (or pos 1))))
@@ -90,7 +94,7 @@ test-backward-token
 (ert-deftest sh-script-test-do-fontification ()
   "Test that \"do\" gets fontified correctly, even with no \";\"."
   (with-temp-buffer
-    (shell-script-mode)
+    (sh-script-tests-shell-script-mode)
     (insert "for i do echo 1; done")
     (font-lock-ensure)
     (goto-char (point-min))





  reply	other threads:[~2024-04-04 15:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04 13:37 bug#70196: 30.0.50; sh-script-tests fails Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-04 14:05 ` Eli Zaretskii
2024-04-04 14:32   ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-04 15:02     ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-04 15:46       ` Eli Zaretskii [this message]
2024-04-04 16:31         ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-04 18:38           ` Eli Zaretskii
2024-04-05 17:49             ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=864jch6sge.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=70196@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).