OPTION(CLITK_BUILD_VV "Build vv the 4D visualizer (requires VTK and QT)" ON)
IF (CLITK_BUILD_VV)
- add_subdirectory(vv)
+ ADD_SUBDIRECTORY(vv)
ENDIF(CLITK_BUILD_VV)
#Support for the CTest dashboard testing system
INCLUDE(CTest)
#=========================================================
-add_subdirectory(tests)
-add_subdirectory(tests/tools)
+IF (BUILD_TESTING)
+ ADD_SUBDIRECTORY(tests)
+ENDIF(BUILD_TESTING)
#=========================================================
-# Add test apps and test executions to this part
-# Test apps are compiled as any other app in the
-# project. Test executions are run using "make test"
-#
+# Tests are organized to mirror the clitk directory tree.
+# Eacho subdirectory has its own CMakeLists.txt with the compiling directives
+
IF (BUILD_TESTING)
- # clitkImageInfo
- ADD_EXECUTABLE(clitkImageInfoTest tools/clitkImageInfoTest.cxx)
- TARGET_LINK_LIBRARIES(clitkImageInfoTest ITKIO)
- ADD_TEST(NAME clitkImageInfoTest COMMAND clitkImageInfoTest)
+ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/tests/bin)
+
+ FIND_PATH(CLITK_DATA_PATH data)
+ IF (CLITK_DATA_PATH STREQUAL "CLITK_DATA_PATH-NOTFOUND")
+ MESSAGE(FATAL_ERROR "Data path must be given when tests are enabled.")
+ ENDIF (CLITK_DATA_PATH STREQUAL "CLITK_DATA_PATH-NOTFOUND")
+
+ ADD_DEFINITIONS(-DCLITK_DATA_PATH='"${CLITK_DATA_PATH}"')
- # clitkWriteDicomSeries
- ADD_EXECUTABLE(clitkWriteDicomSeriesTest tools/clitkWriteDicomSeriesTest.cxx)
- TARGET_LINK_LIBRARIES(clitkWriteDicomSeriesTest ITKIO)
- ADD_TEST(NAME clitkWriteDicomSeriesTest COMMAND clitkWriteDicomSeriesTest)
+ ADD_SUBDIRECTORY(tools)
+ #ADD_SUBDIRECTORY(segmentation)
+ #ADD_SUBDIRECTORY(registration)
+ #ADD_SUBDIRECTORY(common)
-ENDIF(BUILD_TESTING)
\ No newline at end of file
+ENDIF(BUILD_TESTING)
--- /dev/null
+# Add test apps and test executions to this part
+# Test apps are compiled as any other app in the
+# project. Test executions are run using "make test"
+#
+IF(BUILD_TESTING)
+
+ # clitkImageInfo
+ ADD_EXECUTABLE(clitkImageInfoTest clitkImageInfoTest.cxx)
+ TARGET_LINK_LIBRARIES(clitkImageInfoTest ITKIO)
+ ADD_TEST(NAME clitkImageInfoTest COMMAND clitkImageInfoTest)
+
+ # clitkWriteDicomSeries
+ ADD_EXECUTABLE(clitkWriteDicomSeriesTest clitkWriteDicomSeriesTest.cxx)
+ TARGET_LINK_LIBRARIES(clitkWriteDicomSeriesTest ITKIO)
+ ADD_TEST(NAME clitkWriteDicomSeriesTest COMMAND clitkWriteDicomSeriesTest)
+
+ENDIF(BUILD_TESTING)
#include <iostream>
#include <sstream>
-#include <cassert>
+#include <string>
#include <itksys/SystemTools.hxx>
+
const size_t NUMTESTS=2;
// test files
const char mhd_files[NUMTESTS][128] = {
- "data/4d/mhd/00.mhd",
- "data/4d/mhd/bh.mhd"
+ CLITK_DATA_PATH"/4d/mhd/00.mhd",
+ CLITK_DATA_PATH"/4d/mhd/bh.mhd"
};
// pre-written validation files. the idea
// is that the output generated from the test
// files match the verification files
const char validation_files[NUMTESTS][128] = {
- "data/tools/clitkImageInfoTestValidate3D.out",
- "data/tools/clitkImageInfoTestValidate4D.out"
+ CLITK_DATA_PATH"/tools/clitkImageInfoTestValidate3D.out",
+ CLITK_DATA_PATH"/tools/clitkImageInfoTestValidate4D.out"
};
int main(int argc, char** argv)
{
+ system("pwd");
+
bool failed = false;
for (size_t i = 0; i < NUMTESTS; i++) {
std::ostringstream cmd_line;
const size_t NUMTESTS=1;
const char mhd_files[NUMTESTS][128] = {
- "data/3d/mhd/CT_UNTAGGED2MM_0.mhd"
+ CLITK_DATA_PATH"/3d/mhd/CT_UNTAGGED2MM_0.mhd"
};
const char dcm_dirs[NUMTESTS][128] = {
- "data/3d/dcm/1.2.840.113704.1.111.5556.1240990904.26"
+ CLITK_DATA_PATH"/3d/dcm/1.2.840.113704.1.111.5556.1240990904.26"
};
int main(int argc, char** argv)