From cab233fb961eae265937ddcc6e19d7433558dff0 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sat, 9 Nov 2024 15:53:22 +0100 Subject: [PATCH] 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 --- testing/org-test.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/testing/org-test.el b/testing/org-test.el index 52d38c3fd..0d98d196d 100644 --- a/testing/org-test.el +++ b/testing/org-test.el @@ -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)