diff options
| author | Andreas Politz <politza@hochschule-trier.de> | 2015-04-09 08:19:31 +0200 |
|---|---|---|
| committer | Andreas Politz <politza@hochschule-trier.de> | 2015-04-09 08:38:49 +0200 |
| commit | 83b837e5b51ad92a29ee0f1b2acba915417a920a (patch) | |
| tree | 0eeb7e9f39b55a1a855d65c57edd8aaef8230441 /test | |
| parent | 69834a80619710f09c3fbea721e7611bd8e1c7f6 (diff) | |
Moved test helper functions to run-test.el
Diffstat (limited to 'test')
| -rw-r--r-- | test/pdf-info.ert | 17 | ||||
| -rw-r--r-- | test/run-tests.el | 23 |
2 files changed, 21 insertions, 19 deletions
diff --git a/test/pdf-info.ert b/test/pdf-info.ert index 91fa87a..a2596d9 100644 --- a/test/pdf-info.ert +++ b/test/pdf-info.ert @@ -3,23 +3,6 @@ (require 'pdf-info) (require 'ert) -;; Fake skipped as accepted failures if skip-unless is not available. -(unless (fboundp 'ert--skip-unless) - (defun skip-unless (arg) - (unless arg - (setf (ert-test-expected-result-type - (car ert--running-tests)) - :failed) - (ert-fail (list nil))))) - -(defun pdf-test-relative-edges-p (edges) - (and (consp edges) - (cl-every (lambda (x) - (and (numberp x) - (<= x 1) - (>= x 0))) - edges))) - (ert-deftest pdf-info-open/close () (pdf-test-with-test-pdf (should-not (pdf-info-open)) diff --git a/test/run-tests.el b/test/run-tests.el index 8ba82a6..7bc7059 100644 --- a/test/run-tests.el +++ b/test/run-tests.el @@ -20,8 +20,24 @@ (delete-directory package-user-dir t)))) (package-initialize) (package-install-file pdf-tools-package) -(dolist (file (directory-files "." t "\\.ert\\'")) - (load-file file)) + +;; FIXME: Move functions to new, loadable file. +;; Fake skipped as accepted failures if skip-unless is not available. +(unless (fboundp 'ert--skip-unless) + (defun skip-unless (arg) + (unless arg + (setf (ert-test-expected-result-type + (car ert--running-tests)) + :failed) + (ert-fail (list nil))))) + +(defun pdf-test-relative-edges-p (edges) + (and (consp edges) + (cl-every (lambda (x) + (and (numberp x) + (<= x 1) + (>= x 0))) + edges))) (defmacro pdf-test-with-test-pdf (&rest body) (declare (indent 0) (debug t)) @@ -37,5 +53,8 @@ (kill-buffer)) (pdf-info-quit))))) +(dolist (file (directory-files "." t "\\.ert\\'")) + (load-file file)) + (ert-run-tests-batch-and-exit t) |
