]> git.eshelyaron.com Git - emacs.git/commit
Add `skip-when` macro to `ert-deftest`
authorStefan Kangas <stefankangas@gmail.com>
Sun, 3 Sep 2023 16:45:16 +0000 (18:45 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Mon, 4 Sep 2023 16:25:18 +0000 (18:25 +0200)
commit62f7760e61900b6ac0fb513294129130446b17e7
treeb59a0647398589c394e5b0ab60db815529701d53
parentf9b43107ce706f351dcb88d1a4af1b3ffd9671c5
Add `skip-when` macro to `ert-deftest`

This can help avoid some awkward test skip conditions.

For example, this triple negation:
    (skip-unless (not noninteractive))

Can be written as the simpler:
    (skip-when noninteractive)

* lisp/emacs-lisp/ert.el (ert-deftest): Add new 'skip-when' macro.
(ert--skip-when): New internal function.
* doc/misc/ert.texi (Tests and Their Environment): Document above
new macro.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-skip-when): New test.
doc/misc/ert.texi
etc/NEWS
lisp/emacs-lisp/ert.el
test/lisp/emacs-lisp/ert-tests.el