1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-21 06:55:35 +00:00

org-test-for-executable: Detect stub executables

* testing/org-test.el (org-test-for-executable): Make sure that EXE
can be actually executed.  Some OSes (darwin) provide command stubs,
which are present, but useless to call.

Link: https://orgmode.org/list/CALo8A5ULVNQLhP=yReO-V9Uni=caqkjiQtcWUOrtr1XOXakjYA@mail.gmail.com
This commit is contained in:
Ihor Radchenko 2024-11-09 15:53:22 +01:00
parent 0624f57df3
commit cab233fb96
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B

View File

@ -97,10 +97,14 @@ org-test searches this directory up the directory tree.")
This can be used at the top of code-block-language specific test
files to avoid loading the file on systems without the
executable."
(unless (cl-reduce
(lambda (acc dir)
(or acc (file-exists-p (expand-file-name exe dir))))
exec-path :initial-value nil)
(unless (and (cl-reduce
(lambda (acc dir)
(or acc (file-exists-p (expand-file-name exe dir))))
exec-path :initial-value nil)
;; Sometimes, the program is only available as a stub.
;; Check if it can be actually called.
;; See https://list.orgmode.org/orgmode/CALo8A5XfjiJdFb382J+kACuGw2QPGpqYdE7JUS+h7035MKyO+w@mail.gmail.com/
(= 0 (call-process exe nil nil nil "--version")))
(signal 'missing-test-dependency (list exe))))
(defun org-test-buffer (&optional _file)