summaryrefslogtreecommitdiff
path: root/test
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
parent5465b1e3488b362d44a822e36b0c2e24e518bc40 (diff)
Moved files.
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am4
-rw-r--r--test/install-basic.el42
-rw-r--r--test/install-test.pdfbin0 -> 26257 bytes
-rw-r--r--test/install-test.tex16
4 files changed, 62 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 0000000..d193872
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,4 @@
+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
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)
+
+
+
diff --git a/test/install-test.pdf b/test/install-test.pdf
new file mode 100644
index 0000000..d0f60e6
--- /dev/null
+++ b/test/install-test.pdf
Binary files differ
diff --git a/test/install-test.tex b/test/install-test.tex
new file mode 100644
index 0000000..effaec7
--- /dev/null
+++ b/test/install-test.tex
@@ -0,0 +1,16 @@
+\documentclass{article}
+
+\usepackage[ngerman]{babel}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
+\usepackage{amsmath,amssymb,amsfonts,amstext,amsthm}
+
+\begin{document}
+Hello World !
+\newpage
+Hello World !
+\newpage
+Hello World !
+\newpage
+\end{document}