branch: externals/org
commit a0830f94ea434a3b802b94d8ac9ed286df8df8f4
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    * testing/org-test.el: Avoid looking into .emacs.d when ran 
non-interactively
    
    (org-test-load):
    (org-test-update-id-locations): Set `org-id-locations-file' inside
    test dir, but only when running in batch mode.
    
    Reported-by: Morgan Smith <morgan.j.sm...@outlook.com>
    Link: https://orgmode.org/list/ub84qp$6pu$1...@ciao.gmane.io
---
 testing/org-test.el | 59 +++++++++++++++++++++++++++--------------------------
 1 file changed, 30 insertions(+), 29 deletions(-)

diff --git a/testing/org-test.el b/testing/org-test.el
index 47687b9f7a..6030d33221 100644
--- a/testing/org-test.el
+++ b/testing/org-test.el
@@ -387,35 +387,34 @@ Tramp related features.  We mostly follow
 (defun org-test-load ()
   "Load up the Org test suite."
   (interactive)
-  (setq org-id-locations-file
-        (expand-file-name ".test-org-id-locations" org-test-dir))
-  (cl-flet ((rld (base)
-                ;; Recursively load all files, if files throw errors
-                ;; then silently ignore the error and continue to the
-                ;; next file.  This allows files to error out if
-                ;; required executables aren't available.
-                (mapc
-                 (lambda (path)
-                   (if (file-directory-p path)
-                       (rld path)
-                     (condition-case nil
-                         (when (string-match "\\`[A-Za-z].*\\.el\\'"
-                                             (file-name-nondirectory path))
-                            (let ((feature-name
-                                   (intern
-                                    (file-name-base
-                                     (file-name-nondirectory path)))))
-                             (require feature-name path)))
-                       (missing-test-dependency
-                        (let ((name (intern
-                                     (concat "org-missing-dependency/"
-                                             (file-name-nondirectory
-                                              (file-name-sans-extension 
path))))))
-                          (eval `(ert-deftest ,name ()
-                                    (skip-unless nil) ;; Make it prominent.
-                                   :expected-result :failed (should nil))))))))
-                 (directory-files base 'full
-                                  
"\\`\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*\\.el\\'"))))
+  (cl-flet
+      ((rld (base)
+        ;; Recursively load all files, if files throw errors
+        ;; then silently ignore the error and continue to the
+        ;; next file.  This allows files to error out if
+        ;; required executables aren't available.
+        (mapc
+         (lambda (path)
+           (if (file-directory-p path)
+               (rld path)
+             (condition-case nil
+                 (when (string-match "\\`[A-Za-z].*\\.el\\'"
+                                     (file-name-nondirectory path))
+                    (let ((feature-name
+                           (intern
+                            (file-name-base
+                             (file-name-nondirectory path)))))
+                     (require feature-name path)))
+               (missing-test-dependency
+                (let ((name (intern
+                             (concat "org-missing-dependency/"
+                                     (file-name-nondirectory
+                                      (file-name-sans-extension path))))))
+                  (eval `(ert-deftest ,name ()
+                            (skip-unless nil) ;; Make it prominent.
+                           :expected-result :failed (should nil))))))))
+         (directory-files base 'full
+                          "\\`\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*\\.el\\'"))))
     (rld (expand-file-name "lisp" org-test-dir))))
 
 (defun org-test-current-defun ()
@@ -447,6 +446,8 @@ Tramp related features.  We mostly follow
       (when (buffer-live-p b) (kill-buffer b)))))
 
 (defun org-test-update-id-locations ()
+  (setq org-id-locations-file
+        (expand-file-name ".test-org-id-locations" org-test-dir))
   (org-id-update-id-locations
    (directory-files
     org-test-example-dir 'full

Reply via email to