[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 09/13: tests: Fix spawn with #:environment on MacOS.
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] 09/13: tests: Fix spawn with #:environment on MacOS. |
Date: |
Sun, 20 Oct 2024 15:23:22 -0400 (EDT) |
civodul pushed a commit to branch main
in repository guile.
commit 1746dbbe4d134073087f9ba8220e60a3a02ec8c0
Author: Tomas Volf <~@wolfsden.cz>
AuthorDate: Sat Aug 10 00:54:32 2024 +0200
tests: Fix spawn with #:environment on MacOS.
MacOS adds __CF_USER_TEXT_ENCODING to every program, in similar way GNU
Hurd prepends LD_ORIGIN_PATH (based on the comment). So extend the
logic to do similar stripping on MacOS.
* test-suite/tests/posix.test ("spawn")
["env with #:environment and #:output"]: Strip trailing
__CF_USER_TEXT_ENCODING environment variable when on Darwin.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
test-suite/tests/posix.test | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/test-suite/tests/posix.test b/test-suite/tests/posix.test
index 18dad8902..ac5a3b289 100644
--- a/test-suite/tests/posix.test
+++ b/test-suite/tests/posix.test
@@ -442,12 +442,23 @@
(close-port (car input+output))
(waitpid pid)
- ;; On GNU/Hurd, the exec server prepends 'LD_ORIGIN_PATH' for
- ;; every program: <https://bugs.gnu.org/62501>. Strip it.
- (if (and (string=? "GNU" (utsname:sysname (uname)))
- (string-prefix? "LD_ORIGIN_PATH=" str))
- (string-drop str (+ 1 (string-index str #\newline)))
- str))))
+ (let ((sysname (utsname:sysname (uname))))
+ (cond
+ ((string=? "GNU" sysname)
+ ;; On GNU/Hurd, the exec server prepends 'LD_ORIGIN_PATH' for
+ ;; every program: <https://bugs.gnu.org/62501>. Strip it.
+ (if (string-prefix? "LD_ORIGIN_PATH=" str)
+ (string-drop str (+ 1 (string-index str #\newline)))
+ str))
+ ((string-ci=? "darwin" sysname)
+ ;; MacOS appends '__CF_USER_TEXT_ENCODING' for every program.
Strip
+ ;; it.
+ (let ((pos (string-contains str "__CF_USER_TEXT_ENCODING=")))
+ (if pos
+ (string-drop-right str (- (string-length str) pos))
+ str)))
+ (else
+ str))))))
(pass-if-equal "ls /proc/self/fd"
"0\n1\n2\n3\n" ;fourth FD is for /proc/self/fd
- [Guile-commits] 01/13: Replace SRFI-64 with a new implementation., (continued)
- [Guile-commits] 01/13: Replace SRFI-64 with a new implementation., Ludovic Courtès, 2024/10/20
- [Guile-commits] 07/13: filesys.c: Fix readlink for ports on Darwin., Ludovic Courtès, 2024/10/20
- [Guile-commits] 05/13: tests: Skip tests of abstract Unix sockets on Darwin., Ludovic Courtès, 2024/10/20
- [Guile-commits] 03/13: Fix typo in dynamic wind documentation., Ludovic Courtès, 2024/10/20
- [Guile-commits] 02/13: Fix gbt command in gdbinit, Ludovic Courtès, 2024/10/20
- [Guile-commits] 04/13: tests: Check TCP_NODELAY for non-zero instead of 1., Ludovic Courtès, 2024/10/20
- [Guile-commits] 10/13: tests: Fix spawn if file not found with Gnulib., Ludovic Courtès, 2024/10/20
- [Guile-commits] 08/13: tests: Skip mkdtemp test for invalid template on Darwin., Ludovic Courtès, 2024/10/20
- [Guile-commits] 06/13: tests: Skip hole-related port tests on Darwin., Ludovic Courtès, 2024/10/20
- [Guile-commits] 11/13: Do not depend on tmpnam in posix.test., Ludovic Courtès, 2024/10/20
- [Guile-commits] 09/13: tests: Fix spawn with #:environment on MacOS.,
Ludovic Courtès <=
- [Guile-commits] 12/13: posix.c: Set errno when pipe2 is not available and flags provided., Ludovic Courtès, 2024/10/20
- [Guile-commits] 13/13: Update NEWS., Ludovic Courtès, 2024/10/20