Skip to content

Commit

Permalink
Work towards Travis ci builds of the emacs plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
johan committed May 12, 2013
1 parent 05c52f3 commit 160dd3b
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
*.elc
27 changes: 27 additions & 0 deletions .travis.yml
@@ -0,0 +1,27 @@
# https://github.com/rolandwalker/emacs-travis

language: emacs-lisp

env:
matrix:
- EMACS=emacs24
- EMACS=emacs-snapshot

install:
- if [ "$EMACS" = "emacs24" ]; then
sudo add-apt-repository -y ppa:cassou/emacs &&
sudo apt-get update -qq &&
sudo apt-get install -qq emacs24 emacs24-el;
fi
- 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 &&
sudo apt-get install -qq emacs-snapshot-el emacs-snapshot-gtk;
fi

script:
$EMACS --version && make test EMACS=${EMACS}

# notifications:
# email: false
28 changes: 28 additions & 0 deletions Makefile
@@ -0,0 +1,28 @@
# -*- Makefile -*-

EMACS = emacs

TEST_DIR = ert-tests
TRAVIS_FILE = .travis.yml

# Compile with noninteractive and relatively clean environment.
BATCHFLAGS = -batch -q --no-site-file

SRCS = editorconfig.el
OBJS = $(SRCS:.el=.elc)

%.elc: %.el
${EMACS} $(BATCHFLAGS) -f batch-byte-compile $^

.PHONY: all clean test test-travis

all: $(OBJS)

clean:
-rm -f $(OBJS)

test:
${EMACS} $(BATCHFLAGS) -l editorconfig.el

test-travis:
@if test -z "$$TRAVIS" && test -e $(TRAVIS_FILE); then travis-lint $(TRAVIS_FILE); fi
14 changes: 14 additions & 0 deletions ert-tests/tests.el
@@ -0,0 +1,14 @@
(require 'editorconfig)

;;; interactive

(ert-deftest interactive-test-01 nil
"This test should not run on Travis"
:tags '(:interactive)
(should t))

;;; noninteractive, will run on Travis

(ert-deftest has-feature-01 nil
"minimally working - provides 'editorconfig"
(should (featurep 'editorconfig)))

0 comments on commit 160dd3b

Please sign in to comment.