How do I eval the code when run its test in elisp with Emacs?

大兔子大兔子 提交于 2019-12-24 00:47:14

问题


I'm writing some small puzzles to learn Emacs Lisp.

However, my current workflow is way too tedious :

  1. change the code
  2. eval-region or eval-buffer code
  3. change the test
  4. eval-region or eval-buffer test code
  5. M-x ert, then press enter to run tests

How do I setup Emacs or the tests, so I can just "run the test" and Emacs will eval all codes for me ?


回答1:


You probably should not run your tests within your Emacs session anyway. Rather, run the tests in a fresh Emacs session:

$ emacs -Q -b -l my-source-file.el -l my-test-file.el -f ert-run-tests-batch-and-exit

You can run this from M-x compile.



来源:https://stackoverflow.com/questions/20450737/how-do-i-eval-the-code-when-run-its-test-in-elisp-with-emacs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!