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.

Cheers,
Geoff

On Jan 11, 2009, at 12:36 PM, David Levin wrote:

I'm refactoring and improving UString and String. I want to write tests for these classes. What's the best way to do this?

Thanks,
Dave
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to