I like test-driven development very much. Over time the number of test cases grows and grows. As one consequence, it may become difficult to keep the overview of the results.
As a simple mean to get an overview of my test results I use the HTML pages as generated by the junitreport Ant task. This is IDE independent and works very well for Java projects. However, for Clojure, I didn’t find anything comparable yet, at least not for the standard Clojure unit testing framework in clojure.test.
With clojure.test, there is the option to emit output in some sort of JUnit format. Yet, I found that it cannot be used with junitreport as-is and it lacks some, in my opinion important, information (like timestamps or the duration of tests). Furthermore, I wanted to have some automatism for comfortably generating the HTML formatted test results.
After some digging around, I eventually decided to write my first Leiningen plug-in: test2junit. test2junit automatically generates test results in an “improved” (as compared to standard clojure.test.junit way) JUnit XML format without the need to modify the existing test cases. It optionally executes Ant in order to create the final HTML report.
test2junit is hosted at github: https://github.com/ruedigergad/test2junit You can also get the current version from clojars.org. An exemplary output of an HTML test report generated from XML files emitted by test2junit can be seen here: http://ruedigergad.github.com/clj-assorted-utils/test-results/html/
PS: Great thanks to technomancy in #leiningen @freenode who helped me a lot by pointing me into the right direction for solving some “advanced” Leiningen plug-in challenges.