From d37646a9a1368f0af30099b7d35fa81a526a71a5 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Wed, 4 Feb 2015 14:19:27 +0000 Subject: [PATCH] Add Travis CI testing and Coveralls.io reporting --- .travis.yml | 20 ++++++++++++++++++++ Cask | 5 +++++ Makefile | 18 ++++++++++++++++++ tiny-test.el | 5 ++++- 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .travis.yml create mode 100644 Cask create mode 100644 Makefile diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..fe3ab71 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,20 @@ +language: emacs-lisp +before_install: + # PPA for stable Emacs packages + - sudo add-apt-repository -y ppa:cassou/emacs + # PPA for Emacs nightlies + - sudo add-apt-repository -y ppa:ubuntu-elisp/ppa + # Update and install the Emacs for our environment + - sudo apt-get update -qq + - sudo apt-get install -qq -yy ${EMACS}-nox ${EMACS}-el + # Install cask dependencies + - curl -fsSLo /tmp/cask-master.zip https://github.com/cask/cask/archive/master.zip + - sudo unzip -qq -d /opt /tmp/cask-master.zip + - sudo ln -sf /opt/cask-master/bin/cask /usr/local/bin/cask + - cask +env: + - EMACS=emacs24 + - EMACS=emacs-snapshot +script: + - emacs --version + - make test diff --git a/Cask b/Cask new file mode 100644 index 0000000..5336cec --- /dev/null +++ b/Cask @@ -0,0 +1,5 @@ +(source gnu) +(source melpa) + +(development + (depends-on "undercover")) diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6332238 --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +EMACS ?= emacs +CASK_EXEC ?= cask exec + +all: test + +test: clean-elc + ${MAKE} unit + +unit: + ${CASK_EXEC} ${EMACS} -Q -batch -l tiny-test.el -l tiny.el --eval "(ert t)" + +compile: + ${CASK_EXEC} ${EMACS} -Q -batch -f batch-byte-compile tiny.el + +clean-elc: + rm -f f.elc + +.PHONY: all test diff --git a/tiny-test.el b/tiny-test.el index 05cfcfc..e6cbf0f 100644 --- a/tiny-test.el +++ b/tiny-test.el @@ -1,4 +1,7 @@ -(require 'tiny) +(when (require 'undercover nil t) + (undercover "tiny.el")) + +(require 'tiny nil t) (defun with-text-value (txt fn &rest args) "Return the result of (apply 'FN ARGS), in a temp buffer with TXT,