diff options
| author | Andreas Politz <politza@hochschule-trier.de> | 2015-01-14 23:27:04 +0100 |
|---|---|---|
| committer | Andreas Politz <politza@hochschule-trier.de> | 2015-01-14 23:27:04 +0100 |
| commit | 9867077813e3eda7c54ece18d1a207a31c2a72c8 (patch) | |
| tree | 5b951d48dcf26e9ebeaf2d9efbb216f44c8356c3 | |
| parent | 3d381b26462481ff6035943dab23d04a58c237ef (diff) | |
Restructured test handling.
| -rw-r--r-- | test/Makefile.am | 4 | ||||
| -rw-r--r-- | test/install-basic.el | 42 | ||||
| -rw-r--r-- | test/pdf-info.ert | 12 | ||||
| -rw-r--r-- | test/run-tests.el | 10 | ||||
| -rw-r--r-- | test/test.pdf (renamed from test/install-test.pdf) | bin | 26257 -> 26257 bytes | |||
| -rw-r--r-- | test/test.tex (renamed from test/install-test.tex) | 0 |
6 files changed, 22 insertions, 46 deletions
diff --git a/test/Makefile.am b/test/Makefile.am deleted file mode 100644 index d193872..0000000 --- a/test/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -ELP_TAR_FILE = $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar -TESTS_ENVIRONMENT = $(EMACS) --batch -L $(srcdir) -Q $(top_builddir)/$(ELP_TAR_FILE) -l -TESTS = install-basic.el -EXTRA_DIST = $(TESTS) diff --git a/test/install-basic.el b/test/install-basic.el deleted file mode 100644 index b72ed16..0000000 --- a/test/install-basic.el +++ /dev/null @@ -1,42 +0,0 @@ - -;; This is a very basic test, which merely checks the basic -;; functionality of the epdfinfo program. - -(require 'package) - -(defvar pdf (expand-file-name - "install-test.pdf" - (file-name-directory - (or load-file-name default-directory)))) - -(setq package-user-dir (make-temp-file "pdf-tools.install-basic." t)) - -(ert-deftest pdf-info () - (should-not (pdf-info-open pdf)) - (should (= (pdf-info-number-of-pages pdf) 3)) - (should (= (length (pdf-info-search-string "Hello" nil pdf)) 3)) - (should (pdf-info-close pdf))) - -(add-hook 'kill-emacs-hook - (lambda nil - (when (file-exists-p package-user-dir) - (delete-directory package-user-dir t)))) - -(message "Installing package %s" (buffer-file-name)) -(package-install-file (buffer-file-name)) -(when (and (bound-and-true-p byte-compile-log-buffer) - (buffer-live-p (get-buffer byte-compile-log-buffer))) - (with-current-buffer byte-compile-log-buffer - (save-excursion - (goto-char 1) - (when (re-search-forward ":\\(?:Error\\|Warning\\):" nil t) - (error "Compilation had errors and/or warnings."))))) - -(message "Installing pdf-tools") -(pdf-tools-install) - -(message "Running ERT tests") -(ert-run-tests-batch-and-exit) - - - diff --git a/test/pdf-info.ert b/test/pdf-info.ert new file mode 100644 index 0000000..3f907cb --- /dev/null +++ b/test/pdf-info.ert @@ -0,0 +1,12 @@ + +;; This is a very basic test, which merely checks the basic +;; functionality of the epdfinfo program. + +(require 'pdf-info) + +(ert-deftest pdf-info () + (let* ((pdf (expand-file-name "test.pdf"))) + (should-not (pdf-info-open pdf)) + (should (= (pdf-info-number-of-pages pdf) 3)) + (should (= (length (pdf-info-search-string "Hello" nil pdf)) 3)) + (should (pdf-info-close pdf)))) diff --git a/test/run-tests.el b/test/run-tests.el new file mode 100644 index 0000000..b341d08 --- /dev/null +++ b/test/run-tests.el @@ -0,0 +1,10 @@ + +(cd (file-name-directory load-file-name)) + +(defvar pdf-info-epdfinfo-program (expand-file-name "../server/epdfinfo")) +(unless (file-executable-p pdf-info-epdfinfo-program) + (signal 'file-error (list 'file-executable-p pdf-info-epdfinfo-program))) +(dolist (file (directory-files "." t "\\.ert\\'")) + (load-file file)) +(ert-run-tests-batch-and-exit t) + diff --git a/test/install-test.pdf b/test/test.pdf Binary files differindex d0f60e6..d0f60e6 100644 --- a/test/install-test.pdf +++ b/test/test.pdf diff --git a/test/install-test.tex b/test/test.tex index effaec7..effaec7 100644 --- a/test/install-test.tex +++ b/test/test.tex |
