summaryrefslogtreecommitdiff
path: root/test/install-basic.el
diff options
context:
space:
mode:
authorAndreas Politz <politza@hochschule-trier.de>2015-01-14 09:06:32 +0100
committerAndreas Politz <politza@hochschule-trier.de>2015-01-14 09:06:32 +0100
commitaaff78cc64a91e68081b0779595c6e5bb6e202f7 (patch)
treec4f45ab605697bfd2e94a54743137d1dc91a2da4 /test/install-basic.el
parent5465b1e3488b362d44a822e36b0c2e24e518bc40 (diff)
Moved files.
Diffstat (limited to 'test/install-basic.el')
-rw-r--r--test/install-basic.el42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/install-basic.el b/test/install-basic.el
new file mode 100644
index 0000000..b72ed16
--- /dev/null
+++ b/test/install-basic.el
@@ -0,0 +1,42 @@
+
+;; 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)
+
+
+