blob: b728357504a1dd9d32ccf8af2a9853b7f7bba414 [file] [log] [blame]
Radek Krejcice24ab82015-10-08 15:37:02 +02001cmake_minimum_required(VERSION 2.6)
Radek Krejci6c11eda2015-10-08 16:35:19 +02002find_package(CMocka 1.0.0 REQUIRED)
Radek Krejcice24ab82015-10-08 15:37:02 +02003
4add_executable(test_io test_io.c)
5target_link_libraries(test_io ${CMOCKA_LIBRARIES} ${LIBYANG_LIBRARIES} netconf2)
6add_test(test_io test_io)
7
8if(ENABLE_VALGRIND_TESTS)
9 find_program(valgrind_FOUND valgrind)
10 if(valgrind_FOUND)
11 add_test(test_io_valgrind valgrind --leak-check=full ${CMAKE_BINARY_DIR}/tests/test_io)
12 else(valgrind_FOUND)
13 Message("-- valgrind executable not found! Disabling memory leaks tests")
14 endif(valgrind_FOUND)
15endif()
16
17include_directories(${CMAKE_SOURCE_DIR}/src)
18configure_file(config.h.in config.h)