Clojure on-the-fly unit testing in a separate frame

I watched the amazing video "Emacs rocks" and I noticed that the developers used two windows side by side, where one window is Emacs and the other window (almost) constantly runs unit tests. Video here (this is a really nice IMO):

http://www.youtube.com/watch?v=Zxt-c_N82_w

How can I do the same when working with Clojure?

What I would like to see on the screen will be:

  • .clj file that I am currently editing in the buffer
  • one REPL
  • another window (Emacs frame?), where I could see the results of my unit tests (the module itself is tested either inside each .clj file they are testing, or in separate .clj files, I don’t care)

Ideally, I would like to get the results of the unit tests shown in another Emacs frame, but a regular terminal will do it too (as long as there is at least some color support).

Does anyone do something like this? I am not opposed to using shell scripts or elisp'ing or anything else, as long as this allows you to get a similar setup for Clojure code unit tests.

+5
source share
1 answer

If you added the autotest lein plugin

  • Ctrl-x 2 to split the panel horizontally
  • Ctrl-x 3 to split the top panel into code and test
  • clojure-jack-into put the replica in the lower buffer
  • Mx ansi-term in one of the top panels to get a decent terminal, and then run the lein auto-test in that terminal.
+5
source

All Articles