Skip to content

Instantly share code, notes, and snippets.

@joeheyming
Last active December 3, 2015 06:39
Show Gist options
  • Select an option

  • Save joeheyming/867a5f72295865d9da6b to your computer and use it in GitHub Desktop.

Select an option

Save joeheyming/867a5f72295865d9da6b to your computer and use it in GitHub Desktop.
Example emacs project test targets
.PHONY : test
EMACS ?= emacs
CASK ?= cask
LOADPATH = -L .
ELPA_DIR = \
.cask/$(shell $(EMACS) -Q --batch --eval '(princ emacs-version)')/elpa
test: elpa
$(CASK) exec $(EMACS) -Q -batch $(LOADPATH) \
$(patsubst %,-l %,$(wildcard test/test-*.el)) \
-f ert-run-tests-batch-and-exit
test/test-%: elpa
$(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