[vtk-developers] Automatic input for examples?

David Doria daviddoria+vtk at gmail.com
Wed Jan 13 19:54:51 EST 2010


On Wed, Jan 13, 2010 at 7:47 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Looks good, but the testing infrastructure allows the addition of a
> trailing -I flag, so you should test argc < 2.
>
> On the other hand, if we start mucking up the examples with test code,
> we they start looking more like tests which is something that started
> this whole thing.
>
> For now, I would not add the additional code. When the examples are
> run as tests, the ADD_TEST command provides the data on the command
> line.
>
> ADD_TEST(${KIT}-Finance ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
> TestFinance ${VTK_DATA_ROOT}/Data/financial.txt)
>
> Bill

Bill,

I agree that we definitely do not want to make them look like tests.
However, what I was trying to prevent was uploading a file to the wiki
and saying "download the file and then pass it as the argument to the
example executable". You could just add one line to the example:

Filename = GetInputIfHasVTKData(argc, argv);

And then the user could simply run the executable - cutting out the
steps of uploading the demo data file, downloading the demo data file,
and passing it as an argument.

Although this relies on the user actually having VTKData, which maybe
we shouldn't count on?

I will no do anything for now, but lets all just keep this in the back
of our heads as something that could potentially make things easier in
the future.

Thanks,

David



More information about the vtk-developers mailing list