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.

Revisions

  1. joeheyming revised this gist Dec 3, 2015. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -8,12 +8,16 @@ LOADPATH = -L .
    ELPA_DIR = \
    .cask/$(shell $(EMACS) -Q --batch --eval '(princ emacs-version)')/elpa

    test: 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
    test/test-%: elpa pre-test
    $(CASK) exec $(EMACS) -Q -batch $(LOADPATH) \
    -l $@ \
    -f ert-run-tests-batch-and-exit
  2. joeheyming created this gist Nov 12, 2015.
    24 changes: 24 additions & 0 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    .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 $@