file(GLOB test_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")


add_subdirectory(gtest)

add_executable(runUnitTests ${test_SOURCES})

include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
target_link_libraries(runUnitTests gtest gtest_main)
target_link_libraries(runUnitTests traffic_service_lib)
target_link_libraries(runUnitTests messages)
target_link_libraries(runUnitTests backend)


add_test(NAME unittests COMMAND runUnitTests)

file(GLOB test_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")


add_subdirectory(gtest)

add_executable(runUnitTests ${test_SOURCES})

include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
target_link_libraries(runUnitTests gtest gtest_main)
target_link_libraries(runUnitTests traffic_service_lib)
target_link_libraries(runUnitTests messages)
target_link_libraries(runUnitTests backend)


add_test(NAME unittests COMMAND runUnitTests)

add_custom_target(test_memcheck COMMAND
	valgrind --leak-check=full
	         --show-reachable=no
		 --track-fds=yes
		 --error-exitcode=1
		 --suppressions=${CMAKE_CURRENT_SOURCE_DIR}/valgrind/zeromq.supp
		 ${CMAKE_CURRENT_BINARY_DIR}/runUnitTests)

Add a custom target to run valgrind memcheck
Add a custom target to run valgrind memcheck

I was not able to get the suppressions into the ctest memcheck
integration - so there is now a "make test_memcheck" target.

Signed-off-by: Jan Losinski <577c4104c61edf9f052c616c0c23e67bef4a9955@wh2.tu-dresden.de>
