Commit b7de626d authored by Kasper Marstal's avatar Kasper Marstal
Browse files

ENH: Move test code closer the source that is tested

parent 592250d5
......@@ -15,8 +15,8 @@ set( ${MODULE}_LIBRARIES
# Export tests
set( ${MODULE}_TESTS
selxRegistrationItkv4Test.cxx
selxWBIRDemoTest.cxx
${${MODULE}_SOURCE_DIR}/test/selxRegistrationItkv4Test.cxx
${${MODULE}_SOURCE_DIR}/test/selxWBIRDemoTest.cxx
)
# Module source files
......
......@@ -19,10 +19,10 @@ set( ${MODULE}_LIBRARIES
# Export tests
set( ${MODULE}_TESTS
selxBlueprintTest.cxx
selxComponentFactoryTest.cxx
selxComponentInterfaceTest.cxx
selxOverlordTest.cxx
${${MODULE}_SOURCE_DIR}/Blueprints/test/selxBlueprintTest.cxx
${${MODULE}_SOURCE_DIR}/ComponentInterface/test/selxComponentFactoryTest.cxx
${${MODULE}_SOURCE_DIR}/ComponentInterface/test/selxComponentInterfaceTest.cxx
${${MODULE}_SOURCE_DIR}/ComponentInterface/test/selxOverlordTest.cxx
)
# Module source files
......
......@@ -35,7 +35,8 @@ configure_file(
ESCAPE_QUOTES
)
include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) # selxDataManager.h
include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) # selxDataDirectories.h
add_library( DataManager selxDataManager.cxx )
list( APPEND TEST_LIBRARIES
......@@ -45,12 +46,12 @@ list( APPEND TEST_LIBRARIES
# ---------------------------------------------------------------------
# Build tests
foreach( SuperElastixUnitTestFilename ${SUPERELASTIX_TESTS} )
foreach( SuperElastixUnitTestFileName ${SUPERELASTIX_TESTS} )
# Build tests executables
string( REPLACE ".cxx" "" SuperElastixUnitTest ${SuperElastixUnitTestFilename} )
add_executable( ${SuperElastixUnitTest} ${SuperElastixUnitTestFilename} )
get_filename_component( SuperElastixUnitTest ${SuperElastixUnitTestFileName} NAME )
add_executable( ${SuperElastixUnitTest} ${SuperElastixUnitTestFileName} )
target_link_libraries( "${SuperElastixUnitTest}" ${SUPERELASTIX_LIBRARIES} ${ITK_LIBRARIES} ${TEST_LIBRARIES} )
# Add GoogleTest to CTest
GTEST_ADD_TESTS( ${SuperElastixUnitTest} "--gtest_output=xml:${CMAKE_BINARY_DIR}/Testing/Unit/${SuperElastixUnitTest}.xml" ${SuperElastixUnitTestFilename} )
GTEST_ADD_TESTS( ${SuperElastixUnitTest} "--gtest_output=xml:${CMAKE_BINARY_DIR}/Testing/Unit/${SuperElastixUnitTest}.xml" ${SuperElastixUnitTestFileName} )
endforeach()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment