Skip to content

Instantly share code, notes, and snippets.

@podhmo
Last active January 7, 2019 00:43
Show Gist options
  • Save podhmo/2435226d4e1e504ec5c6d8908c94aa0e to your computer and use it in GitHub Desktop.
Save podhmo/2435226d4e1e504ec5c6d8908c94aa0e to your computer and use it in GitHub Desktop.
(defun my:add (x y) (+ x y))
(require 'ert)
(ert-deftest add20 ()
(should (= 20 (my:add 10 10)))
)
(ert-deftest add21 ()
(should (= 21 (my:add 10 10)))
)
EMACS ?= emacs
SELECTOR ?= t
TESTS ?= $(wildcard *test.el)
test:
$(EMACS) -Q --batch -L . \
-l subr \
$(addprefix -l ,$(TESTS)) \
--eval '(setq ert-batch-backtrace-right-margin 100)' \
--eval '(ert-run-tests-batch-and-exit (quote $(SELECTOR)))'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment