From: Alexey Verkhovsky Date: 2004-07-30T07:43:09+09:00 Subject: Re: Parameterized tests with test/unit On Thu, 2004-07-29 at 02:20, Nathaniel Talbott wrote: > On Jul 24, 2004, at 16:50, Alexey Verkhovsky wrote: > > > Speaking of tests, is there any known way to get test/unit report the > > results in XML, a la Ant Junit runner? Other markup easily convertible > > to HTML would do just as fine. > > Not presently... although you could certainly write a runner to do so. > It'd have a good chance of making its way in to the standard > distribution if you did. I think I will try to do that. Can you help me get the "specification" right? I see it as follows: ui/batch/testrunner.rb, which is a subclass of ui/console/testrunner.rb. It emits same output as console runner to stdout/stderr, but also writes one XML file for each test suite it has to run. Naming convention and format of the XML is same as Ant JUnit runner (to reuse Ant formatter / stylesheets). XML files are placed in the directory specified in a mandatory argument to the constructor. Alternatives: 1. Output directory as an optional argument. I think, very few people really want to write test reports to the root of the project during the build, and therefore such default behavior would be counter-intuitive. Better to fail cleanly with a good error message. 2. Emit output as YAML, and give YAML -> HTML conversion as part of the package. That would be more interesting, but harder. Is there a good YAML -> HTML converter? 3. Can probably package this feature as a mixin to anything that subclasses TestRunnerUtils. Brgds, Alex