Procházet zdrojové kódy

fixed `org-test-load' so that is recursively loads all test files

Eric Schulte před 14 roky
rodič
revize
271d1bb986
1 změnil soubory, kde provedl 9 přidání a 5 odebrání
  1. 9 5
      testing/org-test.el

+ 9 - 5
testing/org-test.el

@@ -127,12 +127,16 @@ currently executed.")
 
 
 ;;; Load and Run tests
-(defun org-load-tests ()
+(defun org-test-load ()
   "Load up the org-mode test suite."
   (interactive)
-  (mapc (lambda (file) (load-file file))
-	(directory-files (expand-file-name "lisp" org-test-dir)
-			 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*\\.el")))
+  (flet ((rload (base)
+		(mapc
+		 (lambda (path)
+		   (if (file-directory-p path) (rload path) (load-file path)))
+		 (directory-files base 'full
+				  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*\\.el"))))
+    (rload (expand-file-name "lisp" org-test-dir))))
 
 (defun org-test-current-defun ()
   "Test the current function."
@@ -143,7 +147,7 @@ currently executed.")
   "Run all defined tests matching \"^org\".
 Load all test files first."
   (interactive)
-  (org-load-tests)
+  (org-test-load)
   (ert "^org"))
 
 (provide 'org-test)