Add the infrastructure required to easily add unit tests and test it with a very simple test file.

This commit is contained in:
Pierre Bourdon
2014-03-02 04:44:56 +01:00
parent 747021e0c8
commit d4ed4adace
5 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,11 @@
add_custom_target(unittests)
add_custom_command(TARGET unittests POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND})
macro(add_dolphin_test target srcs libs)
add_executable(Tests/${target} EXCLUDE_FROM_ALL ${srcs})
target_link_libraries(Tests/${target} ${libs} ${GTEST_BOTH_LIBRARIES})
add_dependencies(unittests Tests/${target})
add_test(NAME ${target} COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Tests/${target})
endmacro(add_dolphin_test)
add_subdirectory(Core)