3

What I tried:

Cloned a package with ert tests (https://github.com/dgutov/robe )
# sidenote this package was previously installed using use-package
emacs ~/robe/core-tests.el
M-x ert

Selector: t Passed: 0 Failed: 0 Skipped: 0 Total: 0/0 Started at: 2019-11-10 12:31:14-0800 Finished. Finished at: 2019-11-10 12:31:14-0800

This feels wrong because obviously the package has more than 0 tests.

Also btw: how do I run tests in "emacs -batch" mode.

1
  • C-h i g (ert) RET
    – phils
    Commented Nov 10, 2019 at 20:51

1 Answer 1

9

When you ran emacs ~/robe/core-tests.el, that opened up the file in your Emacs, right?

Then the tests themselves have to be loaded into Emacs. The ert tests are written in ELisp, so you need to evaluate that file. That can be done with M-x eval-buffer, or if the file is not open, you can run M-x load-file.

Then M-x ert will run those tests. Simply opening the file is not enough.

3
  • wow what a gotcha Commented Nov 11, 2019 at 21:21
  • Please mark the answer as correct if it solved your problem.
    – Beetle B.
    Commented Nov 11, 2019 at 23:53
  • @american-ninja-warrior - please mark the answer correct if it solved the problem.
    – ocodo
    Commented Jul 4, 2022 at 6:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.