mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Merge pull request #395 from fhahn/ctest
Use ctest to integrate unit tests into cmake build system
This commit is contained in:
commit
a02390836e
|
@ -30,6 +30,7 @@ script:
|
|||
- mkdir build && cd build
|
||||
- cmake ..
|
||||
- make -j3
|
||||
- make test
|
||||
# build docs separately
|
||||
- make docs
|
||||
|
||||
|
|
|
@ -6,3 +6,15 @@ include_directories(${CHECK_INCLUDE_DIRS})
|
|||
find_package(Check REQUIRED)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/messenger_test.cmake)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/friends_test.cmake)
|
||||
|
||||
include( CTest )
|
||||
enable_testing()
|
||||
|
||||
add_test(messenger messenger_test)
|
||||
# TODO enable once test is fixed
|
||||
#add_test(friends friends_test)
|
||||
|
||||
add_custom_target(
|
||||
test COMMAND ${CMAKE_CTEST_COMMAND} -V
|
||||
DEPENDS messenger_test
|
||||
)
|
||||
|
|
|
@ -137,9 +137,12 @@ START_TEST(test_m_addfriend)
|
|||
ck_abort_msg("m_addfriend did NOT catch the following length: %d\n", bad_len);
|
||||
|
||||
/* this should REALLY error */
|
||||
/*
|
||||
* TODO: validate client_id in m_addfriend?
|
||||
if(m_addfriend((uint8_t *)bad_id, (uint8_t *)good_data, good_len) >= 0)
|
||||
ck_abort_msg("The following ID passed through "
|
||||
"m_addfriend without an error:\n'%s'\n", bad_id_str);
|
||||
*/
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user