[webkit-dev] Where should unittests live? WAS: Why is gtest in the Source directory?

Ojan Vafai ojan at chromium.org
Thu May 12 10:38:13 PDT 2011


Changing the subject to let the original thread remain on topic of where
gtest itself should live.

Having the unittest file live next to the file it's testing has been great
on projects I've worked on (e.g. webkitpy). It makes it straightforward to
identify if a give file has unittests and to add to them. Unless this would
cause problems for anyone's build systems, I'd vote for this.

If they lived in a separate tree, I'd want the tree to match the Source tree
in structure so that it's clear where the tests for a file live, but that
feels like a lot of unnecessary overhead.

On Thu, May 12, 2011 at 10:24 AM, Dmitry Lomov <dslomov at google.com> wrote:

> I think more important issue to consider is should WebKit unit-tests
> (TestWebKitAPI) live under Tools.
> Unit-tests evolve with the product and an organic part of it - it doesn't
> feel that they constitute a "tool".
>
> Three possible locations come to mind:
> - ./Tests - separate top-level directory, sibling to Source and LayoutTests
> - ./Source/Test - separate directory, but under Source to emphasize that
> tests are part of the source code
> - Scattered around by the files that tests test, as David suggests.
>
> In terms of gtest directory placement, I think it is nice to have all
> third-party libraries live in the same place.
>
> What do people think?
>
> Kind regards,
> Dmitry
>
>
> On Thu, May 12, 2011 at 9:38 AM, David Levin <levin at chromium.org> wrote:
>
>> It sounds like you have a helpful mental mapping for what belongs in each
>> directory that we haven't written anywhere.  Perhaps you could write it down
>> and send it to webkit-dev so that we can make it a common model.
>>
>> It feels like a related topic is why are the unit tests under Tools as
>> opposed to being by the files that they test. Being by the files they tests
>> would make them easier to find and change as needed.  (For an example of
>> where this is done, see
>> http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common where
>> there is file.py and file_unittest.py)
>>
>> dave
>>
>>
>> On Thu, May 12, 2011 at 8:36 AM, Dan Bernstein <mitz at apple.com> wrote:
>>
>>> Is gtest required to build any of the WebKit ports? If not, can it be
>>> moved out of Source and into Tools?
>>>
>>> Thanks,
>>> —Dan
>>> _______________________________________________
>>> webkit-dev mailing list
>>> webkit-dev at lists.webkit.org
>>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>>>
>>
>>
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>>
>>
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20110512/9e583c5b/attachment.html>


More information about the webkit-dev mailing list