Last active
December 3, 2015 06:39
-
-
Save joeheyming/867a5f72295865d9da6b to your computer and use it in GitHub Desktop.
Example emacs project test targets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY : test | |
EMACS ?= emacs | |
CASK ?= cask | |
LOADPATH = -L . | |
ELPA_DIR = \ | |
.cask/$(shell $(EMACS) -Q --batch --eval '(princ emacs-version)')/elpa | |
pre-test: | |
rm -f *.elc | |
$(CASK) exec $(EMACS) -batch -Q -L . -eval "(progn (setq byte-compile-error-on-warn t) (batch-byte-compile))" *.el | |
test: elpa pre-test | |
$(CASK) exec $(EMACS) -Q -batch $(LOADPATH) \ | |
$(patsubst %,-l %,$(wildcard test/test-*.el)) \ | |
-f ert-run-tests-batch-and-exit | |
test/test-%: elpa pre-test | |
$(CASK) exec $(EMACS) -Q -batch $(LOADPATH) \ | |
-l $@ \ | |
-f ert-run-tests-batch-and-exit | |
elpa: $(ELPA_DIR) | |
$(ELPA_DIR): Cask | |
$(CASK) install | |
touch $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment