Skip to content
Snippets Groups Projects
Commit 22199c6f authored by stefan's avatar stefan
Browse files

moved unit test executables from src dir to tests/, new flag for cmake (wheter...

moved unit test executables from src dir to tests/, new flag for cmake (wheter to compile unit tests by default), added tests/ to .gitignore

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2281 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent ea89a680
Branches
Tags
No related merge requests found
CMakeFiles
cmake_install.cmake
stage
tests
dng
gipltng
ost
......
......@@ -28,7 +28,8 @@ option(USE_DOUBLE_PRECISION "whether to compile in double precision"
option(ENABLE_SPNAV "whether 3DConnexion devices should be supported"
OFF)
option(STATIC_PROPERTY_WORKAROUND "workaround for static property bug with some boost/boost_python combinations" OFF)
option(DEPLOYMENT "switch on deployment settings" OFF)
option(DEPLOYMENT "switch on deployment settings" OFF)
option(COMPILE_TESTS "wheter unit tests should be compiled by default" OFF)
if (PREFIX)
set(CMAKE_INSTALL_PREFIX ${PREFIX})
......@@ -223,8 +224,8 @@ include_directories(${Boost_INCLUDE_DIRS}
add_subdirectory(modules)
add_subdirectory(scripts)
add_subdirectory(deployment)
set (FILES_TO_BE_REMOVED stage CMakeFiles)
add_subdirectory(deployment)
set(FILES_TO_BE_REMOVED CMakeFiles stage tests)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"${FILES_TO_BE_REMOVED}")
......@@ -245,4 +246,5 @@ message(STATUS
#set(SPHINX_OPTIONS -c doc/conf -b html -d doc/html/doctrees)
#add_custom_target(doc COMMAND
# ${SPHINX} ${SPHINX_OPTIONS} modules doc/html
# VERBATIM)
\ No newline at end of file
# VERBATIM)
......@@ -474,6 +474,7 @@ macro(ost_unittest MODULE SOURCE_FILES)
set(_SOURCES ${SOURCE_FILES})
set(CPP_TESTS)
set(PY_TESTS)
set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_BINARY_DIR}/tests")
foreach(src ${_SOURCES})
if (${src} MATCHES "\\.py$")
list(APPEND PY_TESTS "${src}")
......@@ -484,7 +485,11 @@ macro(ost_unittest MODULE SOURCE_FILES)
set(_SOURCES ${CPP_TESTS})
set(_test_name "${MODULE}_tests")
if(DEFINED CPP_TESTS)
add_executable(${_test_name} EXCLUDE_FROM_ALL ${_SOURCES})
if(COMPILE_TESTS)
add_executable(${_test_name} ${_SOURCES})
else()
add_executable(${_test_name} EXCLUDE_FROM_ALL ${_SOURCES})
endif()
if (WIN32)
target_link_libraries(${_test_name} ${BOOST_UNIT_TEST_LIBRARIES} "ost_${MODULE}")
add_custom_target("${_test_name}_run"
......@@ -501,8 +506,7 @@ macro(ost_unittest MODULE SOURCE_FILES)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "running checks for module ${MODULE}"
DEPENDS ${_test_name})
add_test("${_test_name}" ${CMAKE_CURRENT_BINARY_DIR}/${_test_name} )
add_test("${_test_name}" ${CMAKE_CURRENT_BINARY_DIR}/${_test_name} )
endif()
add_dependencies(check "${_test_name}_run")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment