Mentions légales du service

Skip to content
Snippets Groups Projects
Commit c254c1df authored by MONSEIGNE Thibaut's avatar MONSEIGNE Thibaut
Browse files

:construction: CTests on sdk directly

parent 1930f827
No related branches found
No related tags found
No related merge requests found
......@@ -249,9 +249,6 @@ INCLUDE("OvInstallLaunchScript")
INCLUDE("OvLinkBoostLib")
INCLUDE("OvDelayLoad")
# Sets the PROJECT_VERSION variable to something, depending on overriding OvSetProjectVersion.cmake files
SET_PROJECT_VERSION()
# Sort target into directories for better visualization in IDE
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
SET(APP_FOLDER Applications)
......@@ -262,35 +259,17 @@ SET(VALIDATION_FOLDER Validation-Tests)
# Traverse these directories and build their components
ADD_SUBDIRECTORY("build-tool/")
ADD_SUBDIRECTORY("documentation/")
ADD_SUBDIRECTORY("common/")
IF(NOT(SKIP_OPENVIBE))
ADD_SUBDIRECTORY("openvibe/")
ENDIF()
IF(NOT(SKIP_KERNEL))
ADD_SUBDIRECTORY("kernel/")
ENDIF()
ADD_SUBDIRECTORY("openvibe/")
ADD_SUBDIRECTORY("kernel/")
ADD_SUBDIRECTORY("modules/")
IF(NOT(SKIP_TOOLKIT))
ADD_SUBDIRECTORY("toolkit/")
ENDIF()
IF(NOT(SKIP_PLUGINS))
ADD_SUBDIRECTORY("plugins/")
ENDIF()
IF(NOT(SKIP_APPLICATIONS))
ADD_SUBDIRECTORY("applications/")
ENDIF()
ADD_SUBDIRECTORY("toolkit/")
ADD_SUBDIRECTORY("plugins/")
ADD_SUBDIRECTORY("applications/")
INSTALL(FILES "${CMAKE_BINARY_DIR}/.install" DESTINATION ${CMAKE_INSTALL_PREFIX})
OPTION(BUILD_TESTING "Include and build unit tests" ON)
IF(BUILD_TESTING)
......@@ -313,3 +292,6 @@ ENDIF()
IF(BUILD_VALIDATION_TEST)
ADD_SUBDIRECTORY("validation-test/")
ENDIF()
# Google CTest
configure_file(CTestTestfile.cmake . @ONLY)
# Add tests subdirs
subdirs("@CMAKE_SOURCE_DIR@/openvibe/test")
#subdirs("@CMAKE_SOURCE_DIR@/common/test")
#subdirs("@CMAKE_SOURCE_DIR@/kernel/test")
#subdirs("@CMAKE_SOURCE_DIR@/toolkit/test")
#subdirs("@CMAKE_SOURCE_DIR@/modules/communication/test")
#subdirs("@CMAKE_SOURCE_DIR@/modules/csv/test")
#subdirs("@CMAKE_SOURCE_DIR@/modules/date/test")
#subdirs("@CMAKE_SOURCE_DIR@/modules/ebml/test")
#subdirs("@CMAKE_SOURCE_DIR@/modules/fs/test")
#subdirs("@CMAKE_SOURCE_DIR@/modules/socket/test")
#subdirs("@CMAKE_SOURCE_DIR@/modules/system/test")
#subdirs("@CMAKE_SOURCE_DIR@/modules/xml/test")
#subdirs("@CMAKE_SOURCE_DIR@/plugins/processing/classification/test")
#subdirs("@CMAKE_SOURCE_DIR@/plugins/processing/data-generation/test")
#subdirs("@CMAKE_SOURCE_DIR@/plugins/processing/feature-extraction/test")
#subdirs("@CMAKE_SOURCE_DIR@/plugins/processing/file-io/test")
#subdirs("@CMAKE_SOURCE_DIR@/plugins/processing/signal-processing/test")
#subdirs("@CMAKE_SOURCE_DIR@/plugins/processing/stimulation/test")
#subdirs("@CMAKE_SOURCE_DIR@/plugins/processing/stream-codecs/test")
#subdirs("@CMAKE_SOURCE_DIR@/plugins/processing/streaming/test")
#subdirs("@CMAKE_SOURCE_DIR@/plugins/processing/tools/test")
\ No newline at end of file
......@@ -144,13 +144,43 @@ FUNCTION(SET_PROJECT_VERSION)
ENDFUNCTION()
#==================================================
# Modify library prefixes and suffixes to comply to Windows or Linux naming
#==================================================
FUNCTION(SET_UNIT_TEST_PROJECT_CONFIG)
FUNCTION(SET_LIB_SUFFIX_PREFFIX)
IF(WIN32)
SET(CMAKE_FIND_LIBRARY_PREFIXES "")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
ELSEIF(APPLE)
SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".a")
ELSE()
SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
ENDIF()
ENDFUNCTION()
#==================================================
# Set All element of Google test projects.
#==================================================
FUNCTION(SET_GTEST_PROJECT_CONFIG)
# IDE Config
SET_PROPERTY(TARGET ${PROJECT_NAME} PROPERTY FOLDER ${TESTS_FOLDER}) # Place project in folder Unit-Tests (for some IDE)
# Valgrind/Memcheck Config
# TODO
# Code Coverage Config
# TODO
# GTest Config
ENABLE_TESTING()
SET_LIB_SUFFIX_PREFFIX() # set The Prefixes and Suffixes for all libs
SET(GTEST_ROOT ${OV_CUSTOM_DEPENDENCIES_PATH}/${CMAKE_FIND_LIBRARY_PREFIXES}gtest) # Set link to Gtest root
FIND_PACKAGE(GTest REQUIRED) # Find Package
INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS}) # Add gtest dir to root include dir
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${GTEST_BOTH_LIBRARIES}) # Add google Test to project
# Install
INSTALL(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${DIST_BINDIR}) # Add executable to bin dir
ENDFUNCTION()
#==================================================
\ No newline at end of file
#==================================================
......@@ -69,5 +69,5 @@ INSTALL(DIRECTORY include/ DESTINATION ${DIST_INCLUDEDIR} FILES_MATCHING PATTERN
# Test applications
# ---------------------------------
IF(BUILD_UNIT_TEST)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(test)
ENDIF()
\ No newline at end of file
......@@ -3,13 +3,13 @@
# https://choosealicense.com/licenses/agpl-3.0/
#######################################################################
PROJECT(openvibe-tests)
PROJECT(openvibe-test)
FILE(GLOB_RECURSE SRC_FILES *.cpp *.hpp)
ADD_EXECUTABLE(${PROJECT_NAME} ${SRC_FILES})
SET_BUILD_PLATFORM() # Default build Platform
SET_UNIT_TEST_PROJECT_CONFIG() # Default Unit Test Config
INCLUDE("FindOpenViBE") # Find OpenViBE base includes and library
SET_BUILD_PLATFORM() # Default build Platform
SET_GTEST_PROJECT_CONFIG() # Default Google Test Config
INCLUDE("FindOpenViBE") # Find OpenViBE base includes and library
ADD_TEST(NAME base COMMAND ${PROJECT_NAME})
ADD_TEST(NAME base COMMAND ${PROJECT_NAME})
\ No newline at end of file
File moved
File moved
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment