[Insight-developers] Adding a test ... failed

Steve M. Robbins steve at sumost.ca
Tue Jul 3 23:36:51 EDT 2012


Hi,

I tried to be clever and add a test to NrrdIO but it's proved harder
than it should be.  I'm following "Approach A" directions on the wiki
http://www.itk.org/Wiki/ITK/Release_4/Modularization/_Add_tests


1. I created ThirdParty/NrrdIO/test/CMakeLists.txt containing:

itk_module_test()
set(ITKNrrdIOTests
    itkNrrdSaneTest.cxx
)

CreateTestDriver(ITKNrrdIO  "${ITKNrrdIO-Test_LIBRARIES}" "${ITKNrrdIOTests}")

itk_add_test(NAME itkNrrdSaneTest
    COMMAND ITKNrrdIOTestDriver itkNrrdSaneTest)


2. Compiling fails:

[  0%] Built target itkzlib
[100%] Built target ITKNrrdIO
[100%] Building CXX object Modules/ThirdParty/NrrdIO/test/CMakeFiles/ITKNrrdIOTestDriver.dir/ITKNrrdIOTestDriver.cxx.o
/home/steve/Packages/insighttoolkit/upstream/ITK/build/Modules/ThirdParty/NrrdIO/test/ITKNrrdIOTestDriver.cxx:6:53: fatal error: itkTestDriverIncludeRequiredIOFactories.h: No such file or directory
compilation terminated.
make[2]: *** [Modules/ThirdParty/NrrdIO/test/CMakeFiles/ITKNrrdIOTestDriver.dir/ITKNrrdIOTestDriver.cxx.o] Error 1
make[1]: *** [Modules/ThirdParty/NrrdIO/test/CMakeFiles/ITKNrrdIOTestDriver.dir/all] Error 2


I can see that ITKNrrdIOTestDriver.cxx is generated and includes
"IncludeRequiredIOFactories.h".  What I can't see is how to get the
right directories on the include path.  None of the examples I looked
at (e.g. ITK/Modules/IO/BMP/test/CMakeLists.txt) use
include_directories() ... what did I do wrong?

Thanks,
-Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20120703/d8b764e9/attachment.pgp>


More information about the Insight-developers mailing list