2009-03-18 12:55:14 +03:00
|
|
|
project(tests C)
|
2008-02-27 20:56:47 +03:00
|
|
|
|
2012-10-16 12:37:40 +04:00
|
|
|
set(TORTURE_LIBRARY torture)
|
2008-02-27 20:56:47 +03:00
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${CSYNC_PUBLIC_INCLUDE_DIRS}
|
|
|
|
${CSTDLIB_PUBLIC_INCLUDE_DIRS}
|
|
|
|
${CMAKE_BINARY_DIR}
|
2012-10-27 21:27:14 +04:00
|
|
|
${CMOCKA_INCLUDE_DIR}
|
2013-04-17 17:21:38 +04:00
|
|
|
${HTTPBF_PUBLIC_INCLUDE_DIRS}
|
2008-02-27 20:56:47 +03:00
|
|
|
)
|
|
|
|
|
2012-07-11 20:01:08 +04:00
|
|
|
include_directories(${CHECK_INCLUDE_DIRS})
|
2008-02-27 20:56:47 +03:00
|
|
|
# create test library
|
2012-10-16 12:37:40 +04:00
|
|
|
add_library(${TORTURE_LIBRARY} STATIC torture.c cmdline.c)
|
|
|
|
target_link_libraries(${TORTURE_LIBRARY} ${CMOCKA_LIBRARIES} ${CSYNC_LIBRARY} ${CSTDLIB_LIBRARY})
|
2008-02-27 20:56:47 +03:00
|
|
|
|
2012-10-16 12:37:40 +04:00
|
|
|
set(TEST_TARGET_LIBRARIES ${TORTURE_LIBRARY})
|
2008-02-27 20:56:47 +03:00
|
|
|
|
|
|
|
# create tests
|
|
|
|
|
|
|
|
# std
|
2012-10-16 12:37:40 +04:00
|
|
|
add_cmocka_test(check_std_c_alloc std_tests/check_std_c_alloc.c ${TEST_TARGET_LIBRARIES})
|
|
|
|
add_cmocka_test(check_std_c_jhash std_tests/check_std_c_jhash.c ${TEST_TARGET_LIBRARIES})
|
|
|
|
add_cmocka_test(check_std_c_path std_tests/check_std_c_path.c ${TEST_TARGET_LIBRARIES})
|
|
|
|
add_cmocka_test(check_std_c_rbtree std_tests/check_std_c_rbtree.c ${TEST_TARGET_LIBRARIES})
|
|
|
|
add_cmocka_test(check_std_c_str std_tests/check_std_c_str.c ${TEST_TARGET_LIBRARIES})
|
|
|
|
add_cmocka_test(check_std_c_time std_tests/check_std_c_time.c ${TEST_TARGET_LIBRARIES})
|
2008-02-27 20:56:47 +03:00
|
|
|
|
2008-05-09 11:59:26 +04:00
|
|
|
# csync tests
|
2012-10-16 19:23:07 +04:00
|
|
|
# This will be rewritten soon anyway.
|
|
|
|
#add_cmocka_test(check_logger log_tests/check_log.c ${TEST_TARGET_LIBRARIES})
|
|
|
|
|
2012-10-16 12:37:40 +04:00
|
|
|
add_cmocka_test(check_csync_create csync_tests/check_csync_create.c ${TEST_TARGET_LIBRARIES})
|
2012-10-27 17:15:59 +04:00
|
|
|
add_cmocka_test(check_csync_log csync_tests/check_csync_log.c ${TEST_TARGET_LIBRARIES})
|
2012-10-16 12:37:40 +04:00
|
|
|
add_cmocka_test(check_csync_exclude csync_tests/check_csync_exclude.c ${TEST_TARGET_LIBRARIES})
|
|
|
|
add_cmocka_test(check_csync_statedb_load csync_tests/check_csync_statedb_load.c ${TEST_TARGET_LIBRARIES})
|
|
|
|
add_cmocka_test(check_csync_util csync_tests/check_csync_util.c ${TEST_TARGET_LIBRARIES})
|
2013-11-26 14:55:47 +04:00
|
|
|
add_cmocka_test(check_csync_misc csync_tests/check_csync_misc.c ${TEST_TARGET_LIBRARIES})
|
2008-05-09 11:59:26 +04:00
|
|
|
|
|
|
|
# csync tests which require init
|
2012-10-16 12:37:40 +04:00
|
|
|
add_cmocka_test(check_csync_init csync_tests/check_csync_init.c ${TEST_TARGET_LIBRARIES})
|
|
|
|
add_cmocka_test(check_csync_statedb_query csync_tests/check_csync_statedb_query.c ${TEST_TARGET_LIBRARIES})
|
2013-04-22 19:05:13 +04:00
|
|
|
add_cmocka_test(check_csync_commit csync_tests/check_csync_commit.c ${TEST_TARGET_LIBRARIES})
|
2008-02-27 20:56:47 +03:00
|
|
|
|
2008-04-07 19:16:41 +04:00
|
|
|
# vio
|
2012-10-16 12:37:40 +04:00
|
|
|
add_cmocka_test(check_vio_file_stat vio_tests/check_vio_file_stat.c ${TEST_TARGET_LIBRARIES})
|
|
|
|
add_cmocka_test(check_vio vio_tests/check_vio.c ${TEST_TARGET_LIBRARIES})
|
2015-07-01 15:53:47 +03:00
|
|
|
add_cmocka_test(check_vio_ext vio_tests/check_vio_ext.c ${TEST_TARGET_LIBRARIES})
|
2008-04-07 19:16:41 +04:00
|
|
|
|
2008-08-01 17:58:28 +04:00
|
|
|
# sync
|
2012-10-16 12:37:40 +04:00
|
|
|
add_cmocka_test(check_csync_update csync_tests/check_csync_update.c ${TEST_TARGET_LIBRARIES})
|
2008-08-01 17:58:28 +04:00
|
|
|
|
2013-01-28 23:35:35 +04:00
|
|
|
# encoding
|
|
|
|
add_cmocka_test(check_encoding_functions encoding_tests/check_encoding.c ${TEST_TARGET_LIBRARIES})
|
|
|
|
|
2013-04-17 17:21:38 +04:00
|
|
|
# httpbf
|
|
|
|
set(TEST_HTTPBF_LIBRARIES ${TEST_TARGET_LIBRARIES} ${NEON_LIBRARIES})
|
|
|
|
add_cmocka_test(check_httpbf httpbf_tests/hbf_send_test.c ${TEST_HTTPBF_LIBRARIES} )
|
|
|
|
|
2015-07-01 15:51:49 +03:00
|
|
|
if(UNIT_TESTING)
|
|
|
|
INSTALL( FILES "${CMOCKA_LIBRARIES}" DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
|
|
endif(UNIT_TESTING)
|
2012-07-09 16:10:04 +04:00
|
|
|
|