On Jan 12, 2009, at 1:40 PM, Geoffrey Garen wrote:
Hi Dave.
We tend to write unit tests in HTML or JavaScript. If it's possible
to trigger all of the relevant test conditions in HTML or
JavaScript, I'd recommend that.
The next best thing to do is to write a C++ test function, add it to
WebKitTools/DumpRenderTree, and invoke it during DumpRenderTree's
initialization. This solution is not as good because you can't run
it inside a web browser, and a failure in one test will cause all
unit tests to appear to fail.
As a last resort, you could create a new build target specifically
for your unit test. This solution is not as good because most WebKit
developers will not run your test as a part of their daily
development.
We've discussed the possibility of adopting a C++ unit testing
framework in the past. String and UString are cases where this kind of
approach would really shine. It would also be great for basic data
structure classes like Vector and HashMap. We haven't made much
progress on this front, although Eric Seidel made a preliminary patch
a while back to adopt the same unit test framework that Chrome uses,
although it got hung up on build issues.
Regards,
Maciej
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev