123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- add_definitions(-DCC_TESTING_DEBUG)
- if (APPLE)
- add_definitions(-DGTEST_USE_OWN_TR1_TUPLE)
- add_definitions(-D__GLIBCXX__)
- endif (APPLE)
- # Download and unpack googletest at configure time
- configure_file(CMakeLists.txt.in ${CMAKE_BINARY_DIR}/tests/googletest-download/CMakeLists.txt)
- execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
- RESULT_VARIABLE result
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/googletest-download )
- if(result)
- message(FATAL_ERROR "CMake step for googletest failed: ${result}")
- endif()
- execute_process(COMMAND ${CMAKE_COMMAND} --build .
- RESULT_VARIABLE result
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/googletest-download )
- if(result)
- message(FATAL_ERROR "Build step for googletest failed: ${result}")
- endif()
- # Prevent overriding the parent project's compiler/linker
- # settings on Windows
- set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
- # Add googletest directly to our build. This defines
- # the gtest and gtest_main targets.
- add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src
- ${CMAKE_BINARY_DIR}/googletest-build
- EXCLUDE_FROM_ALL)
- # The gtest/gtest_main targets carry header search path
- # dependencies automatically when using CMake 2.8.11 or
- # later. Otherwise we have to add them here ourselves.
- if (CMAKE_VERSION VERSION_LESS 2.8.11)
- include_directories("${gtest_SOURCE_DIR}/include")
- endif()
- # Include the gtest library. gtest_SOURCE_DIR is available due to
- # 'project(gtest)' above.
- include_directories(${LIB_INCL_DIRS})
- ##############
- # Unit Tests
- ##############
- add_executable(testRingBuffer rb/testRingBuffer.cpp)
- target_link_libraries(testRingBuffer gtest gtest_main)
- target_link_libraries(testRingBuffer ${CERECONN_LIB_NAME})
- add_executable(testCommentRingBuffer rb/testCommentRingBuffer.cpp)
- # Standard linking to gtest stuff.
- target_link_libraries(testCommentRingBuffer gtest gtest_main)
- # Extra linking for the project.
- target_link_libraries(testCommentRingBuffer ${CERECONN_LIB_NAME})
- add_executable(testDigInEvRingBuffer rb/testDigInEvRingBuffer.cpp)
- # Standard linking to gtest stuff.
- target_link_libraries(testDigInEvRingBuffer gtest gtest_main)
- # Extra linking for the project.
- target_link_libraries(testDigInEvRingBuffer ${CERECONN_LIB_NAME})
- add_executable(testSampleGroupRingBuffer rb/testSampleGroupRingBuffer.cpp)
- target_link_libraries(testSampleGroupRingBuffer gtest gtest_main)
- # target_link_libraries(testSampleGroupRingBuffer gtest gtest_main ${CERECONN_LIB_NAME})
- add_executable(testCommonAverager car/testCommonAverager.cpp)
- target_link_libraries(testCommonAverager gtest gtest_main)
- add_executable(testCereConnBasics CereConn/testCereConnBasics.cpp)
- target_link_libraries(testCereConnBasics gtest gtest_main)
- target_link_libraries(testCereConnBasics ${CERECONN_LIB_NAME})
- add_executable(testCereConnRecord CereConn/testCereConnRecord.cpp)
- target_link_libraries(testCereConnRecord gtest gtest_main)
- target_link_libraries(testCereConnRecord ${CERECONN_LIB_NAME})
- add_executable(testCereConnHelpers CereConn/testCereConnHelpers.cpp)
- target_link_libraries(testCereConnHelpers gtest gtest_main)
- add_executable(testCereConnSBPE CereConn/testCereConnSBPE.cpp)
- target_link_libraries(testCereConnSBPE gtest gtest_main ${CERECONN_LIB_NAME})
- if (USE_CERELINK_STUB)
- add_executable(testCereConnRecordPerformance CereConn/testCereConnRecordPerformance.cpp)
- target_link_libraries(testCereConnRecordPerformance gtest gtest_main)
- target_link_libraries(testCereConnRecordPerformance ${CERECONN_LIB_NAME})
- endif(USE_CERELINK_STUB)
- add_executable(testSpikeRateEstimator sre/testSpikeRateEstimator.cpp)
- target_link_libraries(testSpikeRateEstimator gtest gtest_main ${CERECONN_LIB_NAME})
- add_executable(testUnitHist sre/testUnitHist.cpp)
- target_link_libraries(testUnitHist gtest gtest_main ${CERECONN_LIB_NAME})
- add_executable(testSpikeRateEstimationMethods sre/testSpikeRateEstimationMethods.cpp)
- target_link_libraries(testSpikeRateEstimationMethods gtest gtest_main ${CERECONN_LIB_NAME})
- add_executable(testSpikeRateEstimatorPerformance sre/testSpikeRateEstimatorPerformance.cpp)
- target_link_libraries(testSpikeRateEstimatorPerformance gtest gtest_main ${CERECONN_LIB_NAME})
- add_executable(testSpikeBandPowerEstimator sbpe/testSpikeBandPowerEstimator.cpp)
- target_link_libraries(testSpikeBandPowerEstimator gtest gtest_main ${CERECONN_LIB_NAME} ${ARMADILLO_LIBRARIES})
- add_executable(testSpikeBandPowerEstimatorPerformance sbpe/testSpikeBandPowerEstimatorPerformance.cpp)
- target_link_libraries(testSpikeBandPowerEstimatorPerformance gtest gtest_main ${CERECONN_LIB_NAME} ${ARMADILLO_LIBRARIES})
- include(GoogleTest)
- gtest_discover_tests(testRingBuffer)
- gtest_discover_tests(testCommentRingBuffer)
- gtest_discover_tests(testDigInEvRingBuffer)
- gtest_discover_tests(testSampleGroupRingBuffer)
- gtest_discover_tests(testCommonAverager)
- gtest_discover_tests(testCereConnBasics)
- gtest_discover_tests(testCereConnRecord)
- gtest_discover_tests(testCereConnHelpers)
- gtest_discover_tests(testCereConnSBPE)
- if (USE_CERELINK_STUB)
- gtest_discover_tests(testCereConnRecordPerformance)
- endif(USE_CERELINK_STUB)
- gtest_discover_tests(testSpikeRateEstimator)
- gtest_discover_tests(testUnitHist)
- gtest_discover_tests(testSpikeRateEstimationMethods)
- gtest_discover_tests(testSpikeRateEstimatorPerformance)
- gtest_discover_tests(testSpikeBandPowerEstimator)
- gtest_discover_tests(testSpikeBandPowerEstimatorPerformance)
|