1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/3e52d0a8ca3d/
Changeset: 3e52d0a8ca3d
User: kehoea
Date: 2018-04-06 13:14:46+00:00
Summary: Avoid blowing the ARG_MAX limit on environment size, os-tests.el
src/ChangeLog addition:
2018-04-06 Aidan Kehoe <kehoea(a)parhasard.net>
* process-unix.c:
* process-unix.c (child_setup):
When execve() fails, print the associated error message.
tests/ChangeLog addition:
2018-04-06 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/os-tests.el (handle-call-process-cases): New.
* automated/os-tests.el :
Rework the call-process-region tests, making the Assert messages
on failure more helpful, and not depending on #'executable-find.
Be polite after the #'substitute-in-file-name tests, remove our
unreasonably large values from the process environment.
Affected #: 4 files
diff -r eb122f8fba85 -r 3e52d0a8ca3d src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2018-04-06 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * process-unix.c:
+ * process-unix.c (child_setup):
+ When execve() fails, print the associated error message.
+
2018-01-04 Aidan Kehoe <kehoea(a)parhasard.net>
Move the X GC cache to using the Lisp hash table structure (as
diff -r eb122f8fba85 -r 3e52d0a8ca3d src/process-unix.c
--- a/src/process-unix.c
+++ b/src/process-unix.c
@@ -896,7 +896,7 @@
Lisp_Object current_dir)
{
Ibyte **env;
- Ibyte *pwd;
+ Ibyte *pwd, *errmess;
#ifdef SET_EMACS_PRIORITY
if (emacs_priority != 0)
@@ -1033,7 +1033,9 @@
/* we've wrapped execve; it translates its arguments */
qxe_execve (new_argv[0], new_argv, env);
- stdout_out ("Can't exec program %s\n", new_argv[0]);
+ GET_STRERROR (errmess, errno);
+
+ stdout_out ("Can't exec program %s: %s\n", new_argv[0], errmess);
_exit (1);
}
diff -r eb122f8fba85 -r 3e52d0a8ca3d tests/ChangeLog
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,12 @@
+2018-04-06 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * automated/os-tests.el (handle-call-process-cases): New.
+ * automated/os-tests.el :
+ Rework the call-process-region tests, making the Assert messages
+ on failure more helpful, and not depending on #'executable-find.
+ Be polite after the #'substitute-in-file-name tests, remove our
+ unreasonably large values from the process environment.
+
2017-12-24 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/mule-tests.el:
diff -r eb122f8fba85 -r 3e52d0a8ca3d tests/automated/os-tests.el
--- a/tests/automated/os-tests.el
+++ b/tests/automated/os-tests.el
@@ -34,60 +34,45 @@
;; in <b9yoeipvwn0.fsf(a)jpl.org>.
;; tac works by lines, unfortunately
-;; #### The contortions around `executable-find' gag me, but I don't have time
-;; to deal today. If we have `executable-find', we should use its value!
-(let* ((original-string "a\nb\nc\nd\n")
- ;; `executable-find' is in a package and may be unavailable.
- (tac-cases (if (and (fboundp 'executable-find) (executable-find
"tac"))
- '((1 . "c\nb\na\nd\n")
- (3 . "a\nc\nb\nd\n")
- (5 . "a\nc\nb\nd\n")
- (7 . "a\nc\nb\nd\n")
- (9 . "a\nd\nc\nb\n"))
- nil))
- (cat-cases (if (and (fboundp 'executable-find) (executable-find
"cat"))
- '((1 . "b\nc\na\nd\n")
- (3 . "a\nb\nc\nd\n")
- (5 . "a\nb\nc\nd\n")
- (7 . "a\nb\nc\nd\n")
- (9 . "a\nd\nb\nc\n"))
- nil))
- cases case)
- (with-temp-buffer
- (Skip-Test-Unless tac-cases
- "tac executable not found"
- "Tests of call-process-region with region deleted after inserting
+(macrolet
+ ((handle-call-process-cases (program &rest cases)
+ (cons
+ 'progn
+ (loop for (pos . result) in cases
+ nconc `((erase-buffer)
+ (insert "a\nb\nc\nd\n")
+ (goto-char ,pos)
+ (Assert (eql (call-process-region 3 7 ,program t t) 0)
+ ,(concat "failed calling " program))
+ (goto-char (point-min))
+ (Assert (equal (buffer-string) ,result)
+ ,(format "test call-process-region, %s, pos %d, "
+ program pos)))))))
+ (with-temp-buffer
+ (Skip-Test-Unless
+ (condition-case nil (call-process "tac") (process-error nil))
+ "tac executable not found"
+ "Tests of call-process-region with region deleted after inserting
tac process output."
- (setq cases tac-cases)
- (while cases
- (setq case (car cases)
- cases (cdr cases))
- (labels ((do-test (pos result)
- (erase-buffer)
- (insert original-string)
- (goto-char pos)
- (call-process-region 3 7 "tac" t t)
- (goto-char (point-min))
- (Assert (looking-at result))))
- (do-test (car case) (cdr case)))))
+ (handle-call-process-cases "tac"
+ (1 . "c\nb\na\nd\n")
+ (3 . "a\nc\nb\nd\n")
+ (5 . "a\nc\nb\nd\n")
+ (7 . "a\nc\nb\nd\n")
+ (9 . "a\nd\nc\nb\n")))
;; if you're in that much of a hurry you can blow cat off
;; if you've done tac, but I'm not going to bother
- (Skip-Test-Unless cat-cases
- "cat executable not found"
- "Tests of call-process-region with region deleted after inserting
+ (Skip-Test-Unless
+ (condition-case nil (call-process "cat") (process-error nil))
+ "cat executable not found"
+ "Tests of call-process-region with region deleted after inserting
cat process output."
- (setq cases cat-cases)
- (while cases
- (setq case (car cases)
- cases (cdr cases))
- (labels ((do-test (pos result)
- (erase-buffer)
- (insert original-string)
- (goto-char pos)
- (call-process-region 3 7 "cat" t t)
- (goto-char (point-min))
- (Assert (looking-at result))))
- (do-test (car case) (cdr case)))))))
+ (handle-call-process-cases "cat"
+ (1 . "b\nc\na\nd\n")
+ (3 . "a\nb\nc\nd\n")
+ (5 . "a\nb\nc\nd\n")
+ (7 . "a\nb\nc\nd\n")
+ (9 . "a\nd\nb\nc\n")))))
(loop
with envvar-not-existing = (symbol-name (gensym "whatever"))
@@ -120,8 +105,10 @@
(setenv envvar-existing envvar-existing-val))
for (pre post)
in examples
- do
- (Assert (string= post (substitute-in-file-name pre))))
+ do (Assert (string= post (substitute-in-file-name pre)))
+ ;; Be polite and don't overrun ARG_MAX for any processes called down
+ ;; the line.
+ finally (setenv envvar-existing nil t))
;; Check some restrictions introduced to the ZONE argument to #'encode-time.
Repository URL:
https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.