summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2011-09-24 15:57:05 -0600
committerEric Schulte <schulte.eric@gmail.com>2011-09-24 15:57:14 -0600
commit4446e50e3d6da6eae8ad31f35063914b74d12867 (patch)
treee68782abb4238ad1e9f845ba595435c0e14ec8af
parent706de59f07d5ecfa2c3f30ee6beb80f9cb8e83fe (diff)
downloadorg-mode-4446e50e3d6da6eae8ad31f35063914b74d12867.tar.gz
org tests using throw/catch rather than errors to avoid loading unsupported tests
-rw-r--r--testing/lisp/test-ob-R.el2
-rw-r--r--testing/org-test.el18
2 files changed, 5 insertions, 15 deletions
diff --git a/testing/lisp/test-ob-R.el b/testing/lisp/test-ob-R.el
index d60088c..bc637ff 100644
--- a/testing/lisp/test-ob-R.el
+++ b/testing/lisp/test-ob-R.el
@@ -8,7 +8,7 @@
(org-test-for-executable "R")
(unless (featurep 'ess)
- (signal 'org-test-lib-not-found "ess"))
+ (throw 'missing-test-dependency "ESS"))
(let ((load-path (cons (expand-file-name
".." (file-name-directory
diff --git a/testing/org-test.el b/testing/org-test.el
index 75cb8bf..48376d3 100644
--- a/testing/org-test.el
+++ b/testing/org-test.el
@@ -100,15 +100,6 @@ org-test searches this directory up the directory tree.")
(defconst org-test-link-in-heading-file
(expand-file-name "link-in-heading.org" org-test-dir))
-;; Errors used by test files that shouldn't be run because local
-;; dependencies are missing.
-(put 'org-exe-not-found
- 'error-conditions
- '(error org-test-missing-dependency org-test-exe-not-found))
-(put 'org-lib-not-found
- 'error-conditions
- '(error org-test-missing-dependency org-test-lib-not-found))
-
;;; Functions for writing tests
(defun org-test-for-executable (exe)
@@ -117,7 +108,7 @@ 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 (> (length (shell-command-to-string (format "which %s" exe))) 0)
- (signal 'org-test-exe-not-found exe)))
+ (throw 'missing-test-dependency exe)))
(defun org-test-buffer (&optional file)
"TODO: Setup and return a buffer to work with.
@@ -278,10 +269,9 @@ otherwise place the point at the beginning of the inserted text."
(mapc
(lambda (path)
(if (file-directory-p path)
- (rld path)
- (condition-case nil
- (load-file path)
- (org-test-missing-dependency nil))))
+ (rld path)
+ (catch 'missing-test-dependency
+ (load-file path))))
(directory-files base 'full
"^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*\\.el$"))))
(rld (expand-file-name "lisp" org-test-dir))