summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSebastian Wiesner <lunaryorn@gmail.com>2013-10-20 10:49:41 +0200
committerSebastian Wiesner <lunaryorn@gmail.com>2013-10-20 17:26:50 +0200
commitea51e2dccb29fdec44aa5600efe82868ab4319bc (patch)
tree79299e6d75902bda80ec87302b9ceb61719a9bc2 /test
parent41f8244dba255ce2d2ef565697a79881564e8749 (diff)
Enable testing on Travis CI
Diffstat (limited to 'test')
-rw-r--r--test/test-helper.el26
1 files changed, 22 insertions, 4 deletions
diff --git a/test/test-helper.el b/test/test-helper.el
index 7b11dd3..d005dc5 100644
--- a/test/test-helper.el
+++ b/test/test-helper.el
@@ -32,6 +32,11 @@
(unless noninteractive
(error "The test suite cannot be used interactively."))
+(message "Running tests on Emacs %s" emacs-version)
+
+
+;;;; Directories
+
(eval-and-compile
(defconst pkg-info-test-directory (f-parent (f-this-file))
"Directory of unit tests.")
@@ -40,16 +45,21 @@
(f-parent pkg-info-test-directory))
"Directory of unit tests."))
+
+;;;; Load pkg-info
+
+;; Load compatibility libraries for Emacs 23
+(load (f-join pkg-info-source-directory "compat" "load.el") nil 'no-message)
+
(require 'pkg-info (f-join pkg-info-source-directory "pkg-info.elc"))
+;; Check that we are testing the right pkg-info library
(cl-assert (f-same? (symbol-file #'pkg-info-package-version 'defun)
(f-join pkg-info-source-directory "pkg-info.elc"))
nil "ERROR: pkg-info not loaded from compiled source. Run make compile")
-(defconst pkg-info-version
- (let ((default-directory pkg-info-source-directory))
- (version-to-list (car (process-lines "cask" "version"))))
- "The pkg-info version, to use in unit tests.")
+
+;;;; Provide dummy packages for unit tests
(defconst pkg-info-test-package-directory
(f-join pkg-info-test-directory "elpa")
@@ -70,6 +80,14 @@ Start servant with cask exec servant start")))
(pkg-info-test-initialize-packages)
+
+;;;; Utilities
+
+(defconst pkg-info-version
+ (let ((default-directory pkg-info-source-directory))
+ (version-to-list (car (process-lines "cask" "version"))))
+ "The pkg-info version, to use in unit tests.")
+
(provide 'test-helper)
;; Local Variables: