简体   繁体   中英

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

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. Mx 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 ?

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 Mx compile .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM