[vtk-developers] C++ unit tests

David Cole DLRdave at aol.com
Tue Jul 28 13:16:54 EDT 2015


Silly me. So old school. One of these days, I have to get back into
active contribution mode here, instead of just being a pesky email
thinker...

Let's do it, then. Nobody's given us a reason not to yet.

Unit testing of tens of thousands of VTK methods, coming right up! :-)


D



On Tue, Jul 28, 2015 at 12:46 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> On Tue, Jul 28, 2015 at 10:29 AM, David Cole <DLRdave at aol.com> wrote:
>>
>> Have you tested it on all the typical target VTK platforms already, or
>> is the VTK dashboard going to light up the first time it builds on
>> those ...?
>
>
> You're being silly.  The dashboards run on merge requests specifically to
> catch platform-specific issues so that they can be fixed prior to merge.
> This isn't the old days of VTK where we all pushed directly to master.
>
>  - David
>
>>
>>
>> Presumably you use it on multiple platforms, but probably not quite
>> all of the ones VTK dashboards get tested on.
>>
>>
>> On Tue, Jul 28, 2015 at 10:43 AM, David Gobbi <david.gobbi at gmail.com>
>> wrote:
>> > Hi David (and David),
>> >
>> > The only advantage of my unit test header is that it is a single header
>> > (a short one, too) with zero dependencies.  So it's easy to add to VTK
>> > and it's trivial to maintain.
>> >
>> > If either of you has a better solution, then go ahead and make a merge
>> > request.  I'll review it for you ;)
>> >
>> >  - David
>> >
>> >
>> > On Tue, Jul 28, 2015 at 8:27 AM, David Thompson
>> > <david.thompson at kitware.com>
>> > wrote:
>> >>
>> >> Another project I work on has been using Bandit[1] to good effect.
>> >>
>> >>         David
>> >>
>> >> [1]:http://banditcpp.org/reference.html
>> >>
>> >> On Jul 28, 2015, at 10:01 AM, David Cole via vtk-developers
>> >> <vtk-developers at vtk.org> wrote:
>> >>
>> >> > A single header file unit testing solution sounds like a good thing.
>> >> >
>> >> > ... but ... seems like we could also take advantage of a
>> >> > well-established generally used unit testing framework (like gtest or
>> >> > CppUnit) just as easily, and not clutter the VTK source with
>> >> > yet-another-custom-thing-to-learn-about-VTKs-infrastructure.
>> >> >
>> >> > Would it be just as easy to add unit testing using an external unit
>> >> > testing package? Or are there things about that scenario that are
>> >> > overly complicated that having our own makes simpler...?
>> >> >
>> >> >
>> >> > David C.
>> >> >
>> >> >
>> >> >
>> >> > On Mon, Jul 27, 2015 at 5:25 PM, David Gobbi <david.gobbi at gmail.com>
>> >> > wrote:
>> >> >> Hi All,
>> >> >>
>> >> >> I've always enjoyed using the python unit testing framework in
>> >> >> "vtk.test".
>> >> >> It's been brought up on the list before, but it would be nice if VTK
>> >> >> included a unit test framework for C++, as well.
>> >> >>
>> >> >> For my work projects, I've been using a unit test header that I
>> >> >> wrote a
>> >> >> year
>> >> >> and a half ago:
>> >> >> https://github.com/dgobbi/UnitTest/blob/master/UnitTest.h
>> >> >>
>> >> >> It's a single header file that provides a collection of macros for
>> >> >> building
>> >> >> unit tests, it's meant to be innocuous and easy to use.  It could go
>> >> >> into
>> >> >> VTK as Testing/Core/vtkUnitTest.h and people could use it at their
>> >> >> leisure.
>> >> >>
>> >> >> Any thoughts?
>> >> >>
>> >> >> - David
>> >>
>> >
>
>


More information about the vtk-developers mailing list