branch: externals/eglot
commit 39e8b9e46e9d59f6995ec1415c6663f03b9fa032
Author: João Távora <joaotav...@gmail.com>
Commit: João Távora <joaotav...@gmail.com>

    Add (dummy) tests and Travis CI integration
    
    * .travis.yml: New file.
    
    * Makefile: New file.
    
    * README.md: Add Travis badge.
    
    * eglot-tests.el: New file with a dummy test.
---
 .travis.yml    | 19 +++++++++++++++++++
 Makefile       | 35 +++++++++++++++++++++++++++++++++++
 README.md      |  1 +
 eglot-tests.el | 32 ++++++++++++++++++++++++++++++++
 4 files changed, 87 insertions(+)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..7a89327
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,19 @@
+language: generic
+sudo: false
+
+env:
+  global:
+    - EGLOT_TESTING=t # For kicks, so I don't forget this syntax
+  matrix:
+    - EMACS_VERSION=26-prerelease
+
+install:
+  - curl -LO 
https://github.com/npostavs/emacs-travis/releases/download/bins/emacs-bin-${EMACS_VERSION}.tar.gz
+  - tar -xaf emacs-bin-${EMACS_VERSION}.tar.gz -C /
+  # Configure $PATH: Emacs installed to /tmp/emacs
+  - export PATH=/tmp/emacs/bin:${PATH}
+  - emacs --version
+
+script:
+  - make check
+
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..7b85351
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,35 @@
+### Makefile for EGLOT
+### 
+# Variables
+#
+EMACS=emacs
+
+LOAD_PATH=-L .
+
+ELFILES := eglot.el eglot-tests.el
+ELCFILES := $(ELFILES:.el=.elc)
+
+all: compile
+
+# Compilation
+#
+%.elc: %.el
+       $(EMACS) -Q $(LOAD_PATH) --batch -f batch-byte-compile $<
+
+compile: $(ELCFILES)
+
+# Automated tests
+#
+check: compile
+
+check: SELECTOR=t
+check: compile
+       $(EMACS) -Q --batch $(LOAD_PATH)                                \
+               -l eglot-tests                                          \
+               -f ert-run-tests-batch-and-exit                         \
+
+# Cleanup
+#
+clean:
+       find . -iname '*.elc' -exec rm {} \;
+.PHONY: all compile clean check
diff --git a/README.md b/README.md
index 0314664..955ef54 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,4 @@
+[![Build 
Status](https://travis-ci.org/joaotavora/eglot.png)](https://travis-ci.org/joaotavora/eglot)
 Eglot
 -----
 
diff --git a/eglot-tests.el b/eglot-tests.el
new file mode 100644
index 0000000..0f29519
--- /dev/null
+++ b/eglot-tests.el
@@ -0,0 +1,32 @@
+;;; eglot-tests.el --- Tests for eglot.el            -*- lexical-binding: t; 
-*-
+
+;; Copyright (C) 2018  João Távora
+
+;; Author: João Távora <joaotav...@gmail.com>
+;; Keywords: tests
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Tests for eglot.el
+
+;;; Code:
+(require 'eglot)
+(require 'ert)
+
+(ert-deftest dummy () "A dummy test" (should t))
+
+(provide 'eglot-tests)
+;;; eglot-tests.el ends here

Reply via email to