[Insight-developers] SimpleITK - language specific test

Daniel Blezek Blezek.Daniel at mayo.edu
Fri Apr 1 09:02:42 EDT 2011


Hi Gaëtan,

  I wasn't aware of all the flexibility of itkTestDriver.  One reason we
like to define our tests within CXX code is that adding the test to ctest is
automatic, and we don't end up writing CMake code.  But it remains an
option.
-dan


On 3/31/11 8:23 AM, "Gaëtan Lehmann" <gaetan.lehmann at jouy.inra.fr> wrote:

> 
> Hi,
> 
> For wrapping we are using itkTestDriver which seems to do what
> PythonTests.cxx do without the need to edit any cxx file.
> It is also used to test the ITK examples now.
> 
> You may want to look at it.
> 
> [glehmann at marvin ITK-build]$ bin/itkTestDriver --help
> usage: itkTestDriver [options] prg [args]
> 
> itkTestDriver alter the environment, run a test program and compare
> the images
> produced.
> 
> Options:
>    --add-before-libpath PATH
>        Add a path to the library path environment. This option take
> care of
>        choosing the right environment variable for your system.
>        This option can be used several times.
> 
>    --add-before-env NAME VALUE
>        Add a VALUE to the variable name in the environment.
>        The seperator used is the default one on the system.
>        This option can be used several times.
> 
>    --add-before-env-with-sep NAME VALUE SEP
>        Add a VALUE to the variable name in the environment using the
> provided separator.
>        This option can be used several times.
> 
>    --compare TEST BASELINE
>        Compare the TEST image to the BASELINE one.
>        This option can be used several times.
>    --with-threads THREADS
>        Use at most THREADS threads.
> 
>    --without-threads
>        Use at most one thread.
> 
>    --compareNumberOfPixelsTolerance TOLERANCE
>        When comparing images with --compare, allow TOLERANCE pixels to
> differ.
>        Default is 0.
> 
>    --compareRadiusTolerance TOLERANCE
>        Default is 0.
> 
>    --compareIntensityTolerance TOLERANCE
>        Default is 2.0.
> 
>    --
>        The options after -- are not interpreted by this program and
> passed
>        directly to the test program.
> 
>    --help
>        Display this message and exit.
> 
> 
> Gaëtan
> 
> 
> Le 31 mars 11 à 15:14, Bradley Lowekamp a écrit :
> 
>> Dan,
>> 
>> Thanks. I saw the PythonTest.cxx just after I posted. Initially I
>> was looking for a Java one. There does not seem to be an example
>> driver to Tcl, Java, R, or C#. To the Jira issue reporter!
>> 
>> Brad
>> 
>> On Mar 31, 2011, at 8:59 AM, Daniel Blezek wrote:
>> 
>>> Sure.  Write the test in Python, the Examples directory is a good
>>> place to put it.  Your script should take input and output images,
>>> with optional arguments.  Edit the PythonTests.cxx file in Testing/
>>> Unit.  This constructs a command line to call the correct Python
>>> and passes in test data.  Once ³RunExecutable² finishes, you need
>>> to check the output (for baseline or hash).
>>> 
>>> -dan
>>> 
>>> On 3/30/11 1:06 PM, "Bradley Lowekamp" <blowekamp at mail.nih.gov>
>>> wrote:
>>> 
>>>> Dan,
>>>> 
>>>> I would like to write a test just for python. I am not sure how to
>>>> do it with our current testing frame work. Can you provide some
>>>> insight?
>>>> 
>>>> Thanks,
>>>> Brad
>>>> 
>>>> ========================================================
>>>> 
>>>> Bradley Lowekamp
>>>> 
>>>> Lockheed Martin Contractor for
>>>> 
>>>> Office of High Performance Computing and Communications
>>>> 
>>>> National Library of Medicine
>>>> 
>>>> blowekamp at mail.nih.gov
>>>> 
>>>> 
>>>> 
>>> 
>>> -- 
>>> Daniel Blezek, PhD
>>> Medical Imaging Informatics Innovation Center
>>> 
>>> P 127 or (77) 8 8886
>>> T 507 538 8886
>>> E blezek.daniel at mayo.edu
>>> 
>>> Mayo Clinic
>>> 200 First St. S.W.
>>> Harwick SL-44
>>> Rochester, MN 55905
>>> mayoclinic.org
>>> "It is more complicated than you think." -- RFC 1925
>> 
>> ========================================================
>> Bradley Lowekamp
>> Lockheed Martin Contractor for
>> Office of High Performance Computing and Communications
>> National Library of Medicine
>> blowekamp at mail.nih.gov
>> 
>> 
>> _______________________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Kitware offers ITK Training Courses, for more information visit:
>> http://kitware.com/products/protraining.html
>> 
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-developers

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.daniel at mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org
"It is more complicated than you think." -- RFC 1925



More information about the Insight-developers mailing list