GNU bug report logs - #70196
30.0.50; sh-script-tests fails

Previous Next

Package: emacs;

Reported by: Michael Albinus <michael.albinus <at> gmx.de>

Date: Thu, 4 Apr 2024 13:38:02 UTC

Severity: normal

Found in version 30.0.50

Fixed in version 30.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 70196 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 70196 <at> debbugs.gnu.org
Subject: Re: bug#70196: 30.0.50; sh-script-tests fails
Date: Thu, 04 Apr 2024 18:46:57 +0300
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: 70196 <at> 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))




This bug report was last modified 1 year and 104 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.