[Cppunit-devel] An XML syntax to generate tests?
Brought to you by:
blep
From: Philippe L. <phi...@ca...> - 2002-06-07 16:21:15
|
Hi, I'm wondering if anyone as started on writing an XML syntax to generate = tests. For instance, I have a method that I want to call. It has 4 parameters. Each of those = has valid ranges. I want to be sure that the method generates the proper = error messages and proper outputs. So I could do 10 test methods or do a single general method which takes = 4 inputs and returns one value. I would just have to generate an = appropriate return string based on the errors encountered inside the = call to the test function.=20 Then I could have a test generator that either parses the XML to = generate a C++ class that gets compiled into the test suite (probably = the more portable solution, even if more awkward to use). Or I have a = generator that dynamically reads and create those test functions. Now, has anyone worked on something like this ? The above is already = available from JUnit but I didn't see any mentions of a cppunit = extension that would allow me to do this. Hopefully I just missed it :) Phil PS, The format would be <testCase name=3D"CreateMember"> <inputs> <input name=3D"Login"/> <input name=3D"FirstName"/> <input name=3D"LastName"/> <input name=3D"Password"/> </inputs> <tests> <test> <Login></Login> <FirstName>John</FirstName> <LastName>Smith</LastName> <Password></Password> <result>Login Invalid</result> </test> <test> <Login>John</Login> <FirstName>John</FirstName> <LastName>Smith</LastName> <Password>John</Password> <result>Password same as Login</result> </test> =20 <test> <Login>John</Login> <FirstName>John</FirstName> = <LastName>SmithXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</= LastName> <Password>abbaaaba</Password> <result>LastName too long</result> </test> <test> <Login>john</Login> <FirstName>John</FirstName> <LastName>Smith</LastName> <Password>Bob</Password> <result>Ok</result> </test> </tests> </testCase> |