[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/popup 07901c6 023/184: Merge pull request #15 from tkf/tra
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/popup 07901c6 023/184: Merge pull request #15 from tkf/travis-ci |
Date: |
Wed, 6 Oct 2021 00:00:59 -0400 (EDT) |
branch: elpa/popup
commit 07901c6092ccbee2a6977dbbe670bd2c70cccb06
Merge: f15c82b 2609811
Author: Takafumi Arakaki <aka.tkf@gmail.com>
Commit: Takafumi Arakaki <aka.tkf@gmail.com>
Merge pull request #15 from tkf/travis-ci
This PR adds:
* Automated tests in Travis CI.
* ERT as git submodules `lib/ert`.
* `travis-ci` make target in Makfile, so that tests ran on Travis CI
server can be ran in local machine by `make travis-ci`.
---
.gitmodules | 3 ++
.travis.yml | 14 ++++++++
Makefile | 5 +++
lib/ert | 1 +
popup-test.el => tests/popup-interactive-test.el | 0
tests/popup-test.el | 18 ++++++++++
tests/run-test.el | 42 ++++++++++++++++++++++++
7 files changed, 83 insertions(+)
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..e31e75c
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "lib/ert"]
+ path = lib/ert
+ url = git://github.com/ohler/ert.git
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..57f385b
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,14 @@
+language: emacs-lisp
+before_install:
+ - git submodule update --init
+ - if [ "$EMACS" = 'emacs-snapshot' ]; then
+ sudo add-apt-repository -y ppa:cassou/emacs &&
+ sudo apt-get update -qq &&
+ sudo apt-get install -qq
+ emacs-snapshot-el emacs-snapshot-gtk emacs-snapshot;
+ fi
+env:
+ - EMACS=emacs
+ - EMACS=emacs-snapshot
+script:
+ make travis-ci EMACS=$EMACS
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..418837a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,5 @@
+EMACS=emacs
+
+travis-ci:
+ ${EMACS} --version
+ ${EMACS} -batch -Q -l tests/run-test.el
diff --git a/lib/ert b/lib/ert
new file mode 160000
index 0000000..00aef6e
--- /dev/null
+++ b/lib/ert
@@ -0,0 +1 @@
+Subproject commit 00aef6e43d44c6f25323d1a7bdfdc929a3b4ce04
diff --git a/popup-test.el b/tests/popup-interactive-test.el
similarity index 100%
rename from popup-test.el
rename to tests/popup-interactive-test.el
diff --git a/tests/popup-test.el b/tests/popup-test.el
new file mode 100644
index 0000000..e51e01f
--- /dev/null
+++ b/tests/popup-test.el
@@ -0,0 +1,18 @@
+(require 'ert)
+
+(require 'popup)
+
+(defmacro popup-test-with-common-setup (&rest body)
+ (declare (indent 0) (debug t))
+ `(save-excursion
+ (with-temp-buffer
+ (erase-buffer)
+ (let ((popup (popup-create (point) 10 10)))
+ ,@body
+ (popup-delete popup)))))
+
+(ert-deftest popup-test-simple ()
+ (popup-test-with-common-setup
+ (popup-set-list popup '("foo" "bar" "baz"))
+ (popup-draw popup)
+ (should (equal (popup-list popup) '("foo" "bar" "baz")))))
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))
- [nongnu] elpa/popup 0bead7c 086/184: Use cl-lib functions instead of cl in tests, (continued)
- [nongnu] elpa/popup 0bead7c 086/184: Use cl-lib functions instead of cl in tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 29c6db4 130/184: Pass filtering function as an argument to popup-menu*, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 5374e55 110/184: Merge pull request #73 from auto-complete/add-initial-index-test, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 47008e1 135/184: Allow the user to specify a custom function to build the regexp in isearch, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 3d62f15 161/184: Merge pull request #112 from PuercoWork/patch-1, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup cf2cefe 166/184: Fixed compile warning, free variable from display line numbers., ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 51f4430 171/184: Fixed to not use emacs 26.1 as dep., ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 28762fc 138/184: Improve definition, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 88efff5 010/184: Not to insert newlines., ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup bb4bb26 019/184: git mv popup-test.el tests/popup-interactive-test.el, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 07901c6 023/184: Merge pull request #15 from tkf/travis-ci,
ELPA Syncer <=
- [nongnu] elpa/popup 31779da 028/184: Fix test case bug when batch mode., ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 4a31175 033/184: Split setup macro to support extra setup, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 52059d6 055/184: Merge pull request #24 from tkf/summary-overflow, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup d655fd2 057/184: Merge pull request #25 from tkf/truncated-summary, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup a33775f 047/184: Add test case:popup-menu*, popup-cascade-menu, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 6f00052 072/184: Introduce version number, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 5a892e5 063/184: Do not use summary-face for selected item, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup d1dd7c4 124/184: Merge pull request #81 from auto-complete/fix-readme-about-installation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 1f1f7a0 120/184: refactoring #80, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup bb51a53 107/184: Merge branch 'add-initial-index', ELPA Syncer, 2021/10/06