Hi Stuart,

Stuart Sierra wrote:
> Not an April Fool's joke!  New lib "clojure.contrib.test-is.tap" adds
> Test Anything Protocol (TAP) support to test-is.  Use it like this:
> 
> ;;   (use 'clojure.contrib.test-is)
> ;;   (use 'clojure.contrib.test-is.tap)
> ;;
> ;;   (with-tap-output
> ;;    (run-tests 'my.cool.library))

Cool :).

> Warning: this doesn't work with clojure.contrib.test-clojure/run.  I'm
> not sure why.  I think it has something to do with how test-clojure/
> run loads files.  If anyone can shed some light on that, I'd
> appreciate it.  Loading the files individually and calling
> (with-tap-output (run-all-tests))
> works correctly.

I encountered the same problem when implementing JUnit-compatible XML 
output for test-is, and my guess (without having investigated 
thoroughly) is that it is indeed how test-clojure loads files.  It pulls 
in the namespaces under test using:

(apply require :reload-all namespaces)

I guess that because test-is itself is included in these namespaces, 
your redefinitions of the reporting methods are lost.  I worked around 
this myself for now by writing my own function to take a list of 
namespaces and run the tests in the way test-clojure does, allowing me 
to time the redefinitions to happen after the namespaces under test are 
pulled in.

Out of interest, are you interested in other output formats for test-is? 
  I chose JUnit compatible as a defacto-standard -- it integrates with 
the unofficial build server I have been working on as well as many other 
tools.  I have it working but in need of some tweaks and cleanups.  I am 
happy to donate the code (contributor agreement is in the mail to Rich) 
when I clean it up.  It could also easily live outside of test-is as an 
optional extension, in which case I will probably make it public on GitHub.

Cheers,
Jason

-- 
Pulse - Continuous Integration made easy.
Does your project have a pulse?
Try it free at: http://zutubi.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to