branch: elpa/with-simulated-input
commit e66a24d067f5ee9fc64da7f28a0205cfe6ce4e73
Author: Ryan C. Thompson <[email protected]>
Commit: Ryan C. Thompson <[email protected]>
Add Makefile and code coverage
---
.travis.yml | 5 ++++-
Cask | 3 ++-
Makefile | 21 +++++++++++++++++++++
tests/test-with-simulated-input.el | 4 ++++
4 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 261debf042..2edd23fdd2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,6 @@
language: generic
+dist: trusty
+sudo: false
env:
matrix:
@@ -30,4 +32,5 @@ before_script:
- cask install
script:
- cask exec buttercup -L .
+ - make compile
+ - make test
diff --git a/Cask b/Cask
index 8fa7ae5b9d..02b30015b4 100644
--- a/Cask
+++ b/Cask
@@ -14,4 +14,5 @@
:git "https://github.com/DarwinAwardWinner/emacs-buttercup.git"
:branch "show-exprs"
:files ("*.el"
- ("bin" "bin/*"))))
+ ("bin" "bin/*")))
+ (depends-on "undercover"))
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000000..794301a427
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,21 @@
+ELISP_FILES := $(shell cask files)
+ELC_FILES := $(patsubst %.el,%.elc,$(ELISP_FILES))
+
+.PHONY: test compile clean
+.INTERMEDIATE: .compile.intermediate
+
+all: test
+
+# We run clean-elc because undercover.el doesn't support elc files
+test:
+ cask clean-elc
+ cask exec buttercup -L .
+
+compile: $(ELC_FILES)
+
+$(ELC_FILES): .compile.intermediate
+.compile.intermediate: $(ELISP_FILES)
+ cask build
+
+clean:
+ cask clean-elc
diff --git a/tests/test-with-simulated-input.el
b/tests/test-with-simulated-input.el
index 63a854db7d..ea0f50f638 100644
--- a/tests/test-with-simulated-input.el
+++ b/tests/test-with-simulated-input.el
@@ -1,5 +1,9 @@
;;; -*- lexical-binding: t -*-
+(require 'undercover)
+(undercover "*.el"
+ (:exclude "test-*.el"))
+
(require 'with-simulated-input)
(require 'cl-lib)
(require 'buttercup)