Re: How do I generate test suite code for C?

Michael B Allan wrote:
> I'm the author of a plain C implementation called DOMC. I would like to
> generate conformance test sources like:

Welcome.  Yes, the right approach is to create a new transform
test-to-domc.xsl that would generate source code compatible with your C
binding and your selected test harness.  If you aren't already using a test
harness, there is a list of xUnit implementations at
http://www.xprogramming.com/software.htm  Though the tests can be adapted to
other frameworks, the Java code outputs JUnit style assertions.

The packaged test suite is basically a binary drop, to build your own
transforms you need to get the sources out of the CVS.  See
http://www.w3.org/DOM/Test/Documents/DOMTSBuild.html for details on how to
access the CVS repository and build the test suite.

Then I would manually convert some of the tests to your DOM binding and
selected test framework, write the necessary supporting code (the C
equivalent of DOMTestCase.java), get those tests running, and then create
test-to-domc.xsl from test-to-java.xsl.  test-to-java is numbingly complex,
so if you get a few manual tests up and running, then we could collaborate
to get test-to-domc to produce the code.

We have yet to do any test suites for anything other than the two official
bindings, Java and ECMAScript.  There has been a desire to incorporate test
generation for other bindings (Python and C#+System.XML in particular) in
the package, but the need for sleep has precluded doing anything serious on
it.  I don't know if you'd be interested in trying to tackle both DOMC and
other C bindings like libxml as a combined effort that could be contributed
to the W3C.

We are using Ant (http://jakarta.apache.org/ant) as our build tool.
Coincidentally, I've been working on a C/C++ compilation task for Ant as
part of http://ant-contrib.sourceforge.net which might be useful later.

Received on Saturday, 16 March 2002 11:41:11 UTC