[Insight-developers] Tests reworked

William A. Hoffman bill.hoffman@kitware.com
Wed, 06 Mar 2002 21:56:21 -0500


I have changed all the tests to use the new TestDriver code.

To add a new test, you should:

1. edit RegisterTests() in  the Tests.cxx file for the directory you are
working in (itk[Common|Numerics|IO|BasicFilters]Tests.cxx)

Add a REGISTER_TEST macro call, with the name of your test:

void RegisterTests()
{
REGISTER_TEST(itkModifiedTimeTest );

2. instead of main for your test, you have a function with the same name as
the name used in REGISTER_TEST

int itkModifiedTimeTest( int, char** )
{
....}

3. Edit the CMakeLists.txt file
3.1 add the test file to the Tests source list:
SOURCE_FILES(BasicTests_SRCS
itkModifiedTimeTest
3.2. add the test with the ADD_TEST call in cmake, the test name should be 
the same,
but the program that is run is the Tests program for the current directory:

ADD_TEST(itkModifiedTimeTest itkCommonTests itkModifiedTimeTest)


That is all.  Let me know if there are problems.

ITK is now down from 240 to 24 projects in the microsoft workspace!

-Bill