emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/popup 4212a36 021/184: Add tests/run-test.el


From: ELPA Syncer
Subject: [nongnu] elpa/popup 4212a36 021/184: Add tests/run-test.el
Date: Wed, 6 Oct 2021 00:00:59 -0400 (EDT)

branch: elpa/popup
commit 4212a36f3e16094457d62c90c5df0ff5e37beec5
Author: Takafumi Arakaki <aka.tkf@gmail.com>
Commit: Takafumi Arakaki <aka.tkf@gmail.com>

    Add tests/run-test.el
---
 tests/run-test.el | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/tests/run-test.el b/tests/run-test.el
new file mode 100644
index 0000000..4cb8022
--- /dev/null
+++ b/tests/run-test.el
@@ -0,0 +1,42 @@
+;; Usage:
+;;
+;;   emacs -Q -l tests/run-test.el           # interactive mode
+;;   emacs -batch -Q -l tests/run-test.el    # batch mode
+
+
+;; Utils
+(defun popup-test-join-path (path &rest rest)
+  "Join a list of PATHS with appropriate separator (such as /).
+
+\(fn &rest paths)"
+  (if rest
+      (concat (file-name-as-directory path) (apply 'popup-test-join-path rest))
+    path))
+
+(defvar popup-test-dir (file-name-directory load-file-name))
+(defvar popup-root-dir (concat popup-test-dir ".."))
+
+
+;; Setup `load-path'
+(mapc (lambda (p) (add-to-list 'load-path p))
+      (list popup-test-dir
+            popup-root-dir))
+
+
+;; Use ERT from github when this Emacs does not have it
+(unless (locate-library "ert")
+  (add-to-list
+   'load-path
+   (popup-test-join-path popup-root-dir "lib" "ert" "lisp" "emacs-lisp"))
+  (require 'ert-batch)
+  (require 'ert-ui))
+
+
+;; Load tests
+(load "popup-test")
+
+
+;; Run tests
+(if noninteractive
+    (ert-run-tests-batch-and-exit)
+  (ert t))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]