diff --git a/.travis.yml b/.travis.yml index 48f5ce3ae4d..ea2e1ff84c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,6 @@ matrix: - avsm packages: - aspcud # For Opam - - check # For tests. - libconfig-dev # For tox-bootstrapd. - libcv-dev # For av_test. - libhighgui-dev # For av_test. diff --git a/CMakeLists.txt b/CMakeLists.txt index ad038447be4..416dc175403 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -450,14 +450,13 @@ elseif(FORMAT_TEST) endif() function(auto_test target) - if(CHECK_FOUND AND NOT ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" AND ARGV1 STREQUAL "MSVC_DONT_BUILD")) + if(NOT ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" AND ARGV1 STREQUAL "MSVC_DONT_BUILD")) add_executable(auto_${target}_test auto_tests/${target}_test.c) target_link_modules(auto_${target}_test toxcore toxcrypto toxmessenger - toxnetcrypto - ${CHECK_LIBRARIES}) + toxnetcrypto) if(NOT ARGV1 STREQUAL "DONT_RUN") add_test(NAME ${target} COMMAND ${CROSSCOMPILING_EMULATOR} auto_${target}_test) set_tests_properties(${target} PROPERTIES TIMEOUT "${TEST_TIMEOUT_SECONDS}") @@ -465,13 +464,12 @@ function(auto_test target) endif() endfunction() -if(BUILD_TOXAV AND CHECK_FOUND) +if(BUILD_TOXAV) add_definitions(-D__STDC_LIMIT_MACROS=1) add_executable(auto_monolith_test auto_tests/monolith_test.cpp ${ANDROID_CPU_FEATURES}) target_link_modules(auto_monolith_test - ${CHECK_LIBRARIES} ${LIBSODIUM_LIBRARIES} ${OPUS_LIBRARIES} ${VPX_LIBRARIES} diff --git a/INSTALL.md b/INSTALL.md index a79fcd5311a..daac06b7be8 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -176,7 +176,6 @@ Build the container image based on the Dockerfile. The following options are ava | SUPPORT_ARCH_i686 | Support building 32-bit toxcore. | "true" or "false" (case sensitive). | true | | SUPPORT_ARCH_x86_64 | Support building 64-bit toxcore. | "true" or "false" (case sensitive). | true | | SUPPORT_TEST | Support running toxcore automated tests. | "true" or "false" (case sensitive). | false | -| VERSION_CHECK | Version of libcheck. Needed only when SUPPORT_TEST is enabled. | Git branch name. | 0.12.0 | | VERSION_OPUS | Version of libopus to build toxcore with. | Git branch name. | v1.2.1 | | VERSION_SODIUM | Version of libsodium to build toxcore with. | Git branch name. | 1.0.16 | | VERSION_VPX | Version of libvpx to build toxcore with. | Git branch name. | v1.6.1 | @@ -187,7 +186,6 @@ Example of building a container image with options cd other/docker/windows docker build \ --build-arg SUPPORT_TEST=true \ - --build-arg VERSION_CHECK=0.11.0 \ -t toxcore \ . ``` diff --git a/appveyor.yml b/appveyor.yml index 66453ccfd42..925122fe47e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,11 +7,6 @@ install: - choco install curl - refreshenv - if not exist %APPDATA%\downloads mkdir %APPDATA%\downloads -# libcheck -- if not exist %APPDATA%\downloads\check.zip curl -L https://github.com/libcheck/check/archive/0.11.0.zip -o %APPDATA%\downloads\check.zip -- unzip %APPDATA%\downloads\check.zip && cd check-0.11.0 -- if not exist "%PROGRAMFILES%\check\include\check.h" cmake . && msbuild INSTALL.vcxproj -- cd .. # libsodium - mkdir libsodium && cd libsodium - if not exist %APPDATA%\downloads\libsodium.zip curl -L https://download.libsodium.org/libsodium/releases/libsodium-1.0.12-msvc.zip -o %APPDATA%\downloads\libsodium.zip diff --git a/auto_tests/BUILD.bazel b/auto_tests/BUILD.bazel index ea3682b897c..88951f97569 100644 --- a/auto_tests/BUILD.bazel +++ b/auto_tests/BUILD.bazel @@ -22,7 +22,6 @@ cc_library( "//c-toxcore/toxav", "//c-toxcore/toxcore", "//c-toxcore/toxencryptsave", - "@check", ], ) for src in glob(["*_test.c"])] @@ -47,6 +46,5 @@ cc_test( ":monolith", "//c-toxcore/other:monolith", "//c-toxcore/testing:misc_tools", - "@check", ], ) diff --git a/auto_tests/Makefile.inc b/auto_tests/Makefile.inc index 536b08c5efd..6957262a861 100644 --- a/auto_tests/Makefile.inc +++ b/auto_tests/Makefile.inc @@ -5,8 +5,7 @@ check_PROGRAMS = encryptsave_test messenger_autotest crypto_test network_test on AUTOTEST_CFLAGS = \ $(LIBSODIUM_CFLAGS) \ - $(NACL_CFLAGS) \ - $(CHECK_CFLAGS) + $(NACL_CFLAGS) AUTOTEST_LDADD = \ $(LIBSODIUM_LDFLAGS) \ @@ -15,8 +14,7 @@ AUTOTEST_LDADD = \ libtoxencryptsave.la \ $(LIBSODIUM_LIBS) \ $(NACL_OBJECTS) \ - $(NACL_LIBS) \ - $(CHECK_LIBS) + $(NACL_LIBS) diff --git a/auto_tests/check_compat.h b/auto_tests/check_compat.h index e4fde89fcbd..755dea818cf 100644 --- a/auto_tests/check_compat.h +++ b/auto_tests/check_compat.h @@ -1,8 +1,66 @@ -#ifdef _MSC_VER -#define pid_t int -// #include -#endif -#include -#ifdef _MSC_VER -#undef pid_t -#endif +#ifndef CHECK_COMPAT_H +#define CHECK_COMPAT_H + +#include "../toxcore/ccompat.h" + +#include +#include + +#define START_TEST(name) static void name(void) +#define END_TEST + +#define DEFTESTCASE(NAME) test_##NAME() +#define DEFTESTCASE_SLOW(NAME, TIMEOUT) test_##NAME() + +typedef struct Suite Suite; +typedef struct SRunner SRunner; +enum SRunMode { CK_NORMAL }; + +Suite *suite_create(const char *title) +{ + printf("Running test suite: %s\n", title); + return nullptr; +} + +SRunner *srunner_create(Suite *s) +{ + return nullptr; +} + +void srunner_free(SRunner *s) +{ +} + +void srunner_run_all(SRunner *r, int mode) +{ +} + +int srunner_ntests_failed(SRunner *r) +{ + return 0; +} + +#define ck_assert(ok) do { \ + if (!(ok)) { \ + fprintf(stderr, "%s:%d: failed `%s'\n", __FILE__, __LINE__, #ok); \ + exit(EXIT_FAILURE); \ + } \ +} while (0) + +#define ck_assert_msg(ok, ...) do { \ + if (!(ok)) { \ + fprintf(stderr, "%s:%d: failed `%s': ", __FILE__, __LINE__, #ok); \ + fprintf(stderr, __VA_ARGS__); \ + fprintf(stderr, "\n"); \ + exit(EXIT_FAILURE); \ + } \ +} while (0) + +#define ck_abort_msg(...) do { \ + fprintf(stderr, "%s:%d: ", __FILE__, __LINE__); \ + fprintf(stderr, __VA_ARGS__); \ + fprintf(stderr, "\n"); \ + exit(EXIT_FAILURE); \ +} while (0) + +#endif // CHECK_COMPAT_H diff --git a/auto_tests/crypto_test.c b/auto_tests/crypto_test.c index a1b7fd3045b..13d8819fdd2 100644 --- a/auto_tests/crypto_test.c +++ b/auto_tests/crypto_test.c @@ -412,7 +412,7 @@ START_TEST(test_memcmp) "Delta time is too long (%d >= %d)\n" "Time of the same data comparation: %d\n" "Time of the different data comparation: %d", - delta, CRYPTO_TEST_MEMCMP_EPS, same_median, not_same_median); + (int)delta, CRYPTO_TEST_MEMCMP_EPS, (int)same_median, (int)not_same_median); } END_TEST diff --git a/auto_tests/dht_test.c b/auto_tests/dht_test.c index 227b43f72fa..8e735dbd051 100644 --- a/auto_tests/dht_test.c +++ b/auto_tests/dht_test.c @@ -684,7 +684,7 @@ START_TEST(test_dht_create_packet) ck_assert_msg(pkt[0] == NET_PACKET_GET_NODES, "Malformed packet."); ck_assert_msg(memcmp(pkt + 1, key, CRYPTO_SYMMETRIC_KEY_SIZE) == 0, "Malformed packet."); ck_assert_msg(length == 1 + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_NONCE_SIZE + sizeof(plain) + CRYPTO_MAC_SIZE, - "Invalid size. Should be %d got %d", sizeof(pkt), length); + "Invalid size. Should be %u got %d", (unsigned)sizeof(pkt), length); printf("Create Packet Successful!\n"); } diff --git a/auto_tests/helpers.h b/auto_tests/helpers.h index 7b6146a4c3b..ac58684da23 100644 --- a/auto_tests/helpers.h +++ b/auto_tests/helpers.h @@ -17,15 +17,6 @@ #define c_sleep(x) usleep(1000 * (x)) #endif -#define DEFTESTCASE(NAME) \ - TCase *tc_##NAME = tcase_create(#NAME); \ - tcase_add_test(tc_##NAME, test_##NAME); \ - suite_add_tcase(s, tc_##NAME) - -#define DEFTESTCASE_SLOW(NAME, TIMEOUT) \ - DEFTESTCASE(NAME); \ - tcase_set_timeout(tc_##NAME, TIMEOUT) - static const char *tox_log_level_name(TOX_LOG_LEVEL level) { switch (level) { diff --git a/auto_tests/messenger_test.c b/auto_tests/messenger_test.c index 34de65439a0..de5aa7dd78e 100644 --- a/auto_tests/messenger_test.c +++ b/auto_tests/messenger_test.c @@ -249,8 +249,8 @@ START_TEST(test_dht_state_saveloadsave) DHT_save(m->dht, buffer + extra); for (i = 0; i < extra; i++) { - ck_assert_msg(buffer[i] == 0xCD, "Buffer underwritten from DHT_save() @%u", i); - ck_assert_msg(buffer[extra + size + i] == 0xCD, "Buffer overwritten from DHT_save() @%u", i); + ck_assert_msg(buffer[i] == 0xCD, "Buffer underwritten from DHT_save() @%u", (unsigned)i); + ck_assert_msg(buffer[extra + size + i] == 0xCD, "Buffer overwritten from DHT_save() @%u", (unsigned)i); } int res = DHT_load(m->dht, buffer + extra, size); @@ -263,11 +263,12 @@ START_TEST(test_dht_state_saveloadsave) uint8_t *ptr = buffer + extra + offset; sprintf(msg, "Failed to load back stored buffer: 0x%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx @%zu/%zu, code %d", ptr[-2], ptr[-1], ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], offset, size, res & 0x0F); - ck_assert_msg(res == 0, msg); + ck_assert_msg(res == 0, "%s", msg); } size_t size2 = DHT_size(m->dht); - ck_assert_msg(size == size2, "Messenger \"grew\" in size from a store/load cycle: %u -> %u", size, size2); + ck_assert_msg(size == size2, "Messenger \"grew\" in size from a store/load cycle: %u -> %u", (unsigned)size, + (unsigned)size2); VLA(uint8_t, buffer2, size2); DHT_save(m->dht, buffer2); @@ -291,8 +292,8 @@ START_TEST(test_messenger_state_saveloadsave) messenger_save(m, buffer + extra); for (i = 0; i < extra; i++) { - ck_assert_msg(buffer[i] == 0xCD, "Buffer underwritten from messenger_save() @%u", i); - ck_assert_msg(buffer[extra + size + i] == 0xCD, "Buffer overwritten from messenger_save() @%u", i); + ck_assert_msg(buffer[i] == 0xCD, "Buffer underwritten from messenger_save() @%u", (unsigned)i); + ck_assert_msg(buffer[extra + size + i] == 0xCD, "Buffer overwritten from messenger_save() @%u", (unsigned)i); } int res = messenger_load(m, buffer + extra, size); @@ -305,11 +306,12 @@ START_TEST(test_messenger_state_saveloadsave) uint8_t *ptr = buffer + extra + offset; sprintf(msg, "Failed to load back stored buffer: 0x%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx @%zu/%zu, code %d", ptr[-2], ptr[-1], ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], offset, size, res & 0x0F); - ck_assert_msg(res == 0, msg); + ck_assert_msg(res == 0, "%s", msg); } size_t size2 = messenger_size(m); - ck_assert_msg(size == size2, "Messenger \"grew\" in size from a store/load cycle: %u -> %u", size, size2); + ck_assert_msg(size == size2, "Messenger \"grew\" in size from a store/load cycle: %u -> %u", + (unsigned)size, (unsigned)size2); VLA(uint8_t, buffer2, size2); messenger_save(m, buffer2); @@ -346,10 +348,6 @@ static Suite *messenger_suite(void) int main(int argc, char *argv[]) { - Suite *messenger = messenger_suite(); - SRunner *test_runner = srunner_create(messenger); - int number_failed = 0; - friend_id = hex_string_to_bin(friend_id_str); good_id_a = hex_string_to_bin(good_id_a_str); good_id_b = hex_string_to_bin(good_id_b_str); @@ -374,6 +372,10 @@ int main(int argc, char *argv[]) "the tests will continue now...\n\n", stderr); } + Suite *messenger = messenger_suite(); + SRunner *test_runner = srunner_create(messenger); + int number_failed = 0; + srunner_run_all(test_runner, CK_NORMAL); number_failed = srunner_ntests_failed(test_runner); diff --git a/auto_tests/network_test.c b/auto_tests/network_test.c index 9e3e0e15904..1885c81fd24 100644 --- a/auto_tests/network_test.c +++ b/auto_tests/network_test.c @@ -38,7 +38,7 @@ START_TEST(test_addr_resolv_localhost) int res = addr_resolve(localhost, &ip, nullptr); - ck_assert_msg(res > 0, "Resolver failed: %u, %s (%x, %x)", errno, strerror(errno)); + ck_assert_msg(res > 0, "Resolver failed: %u, %s", errno, strerror(errno)); char ip_str[IP_NTOA_LEN]; ck_assert_msg(ip.family == TOX_AF_INET, "Expected family TOX_AF_INET, got %u.", ip.family); @@ -54,7 +54,7 @@ START_TEST(test_addr_resolv_localhost) localhost_split = 1; } - ck_assert_msg(res > 0, "Resolver failed: %u, %s (%x, %x)", errno, strerror(errno)); + ck_assert_msg(res > 0, "Resolver failed: %u, %s", errno, strerror(errno)); ck_assert_msg(ip.family == TOX_AF_INET6, "Expected family TOX_AF_INET6 (%u), got %u.", TOX_AF_INET6, ip.family); IP6 ip6_loopback = get_ip6_loopback(); @@ -71,7 +71,7 @@ START_TEST(test_addr_resolv_localhost) IP extra; ip_reset(&extra); res = addr_resolve(localhost, &ip, &extra); - ck_assert_msg(res > 0, "Resolver failed: %u, %s (%x, %x)", errno, strerror(errno)); + ck_assert_msg(res > 0, "Resolver failed: %u, %s", errno, strerror(errno)); #if USE_IPV6 ck_assert_msg(ip.family == TOX_AF_INET6, "Expected family TOX_AF_INET6 (%u), got %u.", TOX_AF_INET6, ip.family); @@ -149,7 +149,7 @@ START_TEST(test_ip_equal) ip2.ip6.uint8[15]++; res = ip_equal(&ip1, &ip2); - ck_assert_msg(res == 0, "ip_equal( {TOX_AF_INET6, ::1}, {TOX_AF_INET6, ::2} ): expected result 0, got %res.", res); + ck_assert_msg(res == 0, "ip_equal( {TOX_AF_INET6, ::1}, {TOX_AF_INET6, ::2} ): expected result 0, got %u.", res); } END_TEST diff --git a/auto_tests/onion_test.c b/auto_tests/onion_test.c index bf764f67e58..5989df17cc5 100644 --- a/auto_tests/onion_test.c +++ b/auto_tests/onion_test.c @@ -449,7 +449,7 @@ START_TEST(test_announce) for (i = 0; i < NUM_ONIONS; ++i) { onions[i] = new_onions(i + 34655); - ck_assert_msg(onions[i] != nullptr, "Failed to create onions. %u"); + ck_assert_msg(onions[i] != nullptr, "Failed to create onions. %u", i); } IP ip = get_loopback(); diff --git a/auto_tests/tox_many_tcp_test.c b/auto_tests/tox_many_tcp_test.c index 81e6244a6eb..e4309db720c 100644 --- a/auto_tests/tox_many_tcp_test.c +++ b/auto_tests/tox_many_tcp_test.c @@ -259,21 +259,15 @@ START_TEST(test_many_clients_tcp_b) END_TEST -#ifdef TRAVIS_ENV -static const uint8_t timeout_mux = 20; -#else -static const uint8_t timeout_mux = 10; -#endif - static Suite *tox_suite(void) { Suite *s = suite_create("Tox many tcp"); /* Each tox connects to a single tox TCP */ - DEFTESTCASE_SLOW(many_clients_tcp, 4 * timeout_mux); + DEFTESTCASE(many_clients_tcp); /* Try to make a connection to each "older sibling" tox instance via TCP */ - DEFTESTCASE_SLOW(many_clients_tcp_b, 8 * timeout_mux); + DEFTESTCASE(many_clients_tcp_b); return s; } diff --git a/auto_tests/tox_many_test.c b/auto_tests/tox_many_test.c index 3d3aad6d5c7..bacaaff866f 100644 --- a/auto_tests/tox_many_test.c +++ b/auto_tests/tox_many_test.c @@ -139,17 +139,11 @@ START_TEST(test_many_clients) } END_TEST -#ifdef TRAVIS_ENV -static const uint8_t timeout_mux = 20; -#else -static const uint8_t timeout_mux = 10; -#endif - static Suite *tox_suite(void) { Suite *s = suite_create("Tox"); - DEFTESTCASE_SLOW(many_clients, 8 * timeout_mux); + DEFTESTCASE(many_clients); return s; } diff --git a/auto_tests/tox_strncasecmp_test.c b/auto_tests/tox_strncasecmp_test.c index 3a544c00ea8..fc0d2fc8803 100644 --- a/auto_tests/tox_strncasecmp_test.c +++ b/auto_tests/tox_strncasecmp_test.c @@ -29,7 +29,7 @@ void verify(const char *s1, const char *s2, size_t n, Comparison expected) ck_assert_msg(actual == expected, "tox_strncasecmp(\"%s\", \"%s\", %u) == %s, but expected %s.", - s1, s2, n, Comparison_Str[actual], Comparison_Str[expected]); + s1, s2, (unsigned)n, Comparison_Str[actual], Comparison_Str[expected]); } START_TEST(test_general) diff --git a/auto_tests/tox_test.c b/auto_tests/tox_test.c index be6da1d43a1..82c18b3723d 100644 --- a/auto_tests/tox_test.c +++ b/auto_tests/tox_test.c @@ -234,7 +234,7 @@ static void tox_file_chunk_request(Tox *tox, uint32_t friend_number, uint32_t fi } if (sending_pos != position) { - ck_abort_msg("Bad position %llu", position); + ck_abort_msg("Bad position %llu", (unsigned long long)position); } if (length == 0) { @@ -614,8 +614,9 @@ START_TEST(test_few_clients) } ck_abort_msg("Something went wrong in file transfer %u %u %u %u %u %u %llu %llu %llu", sendf_ok, file_recv, - totalf_size == file_size, size_recv == file_size, sending_pos == size_recv, file_accepted == 1, totalf_size, size_recv, - sending_pos); + totalf_size == file_size, size_recv == file_size, sending_pos == size_recv, file_accepted == 1, + (unsigned long long)totalf_size, (unsigned long long)size_recv, + (unsigned long long)sending_pos); } uint32_t tox1_interval = tox_iteration_interval(tox1); @@ -664,8 +665,8 @@ START_TEST(test_few_clients) ck_abort_msg("Something went wrong in file transfer %u %u %u %u %u %u %u %llu %llu %llu %llu", sendf_ok, file_recv, m_send_reached, totalf_size == file_size, size_recv == max_sending, sending_pos == size_recv, file_accepted == 1, - totalf_size, file_size, - size_recv, sending_pos); + (unsigned long long)totalf_size, (unsigned long long)file_size, + (unsigned long long)size_recv, (unsigned long long)sending_pos); } uint32_t tox1_interval = tox_iteration_interval(tox1); @@ -708,8 +709,9 @@ START_TEST(test_few_clients) } ck_abort_msg("Something went wrong in file transfer %u %u %u %u %u %u %llu %llu %llu", sendf_ok, file_recv, - totalf_size == file_size, size_recv == file_size, sending_pos == size_recv, file_accepted == 1, totalf_size, size_recv, - sending_pos); + totalf_size == file_size, size_recv == file_size, sending_pos == size_recv, file_accepted == 1, + (unsigned long long)totalf_size, (unsigned long long)size_recv, + (unsigned long long)sending_pos); } uint32_t tox1_interval = tox_iteration_interval(tox1); @@ -728,17 +730,11 @@ START_TEST(test_few_clients) } END_TEST -#ifdef TRAVIS_ENV -static const uint8_t timeout_mux = 20; -#else -static const uint8_t timeout_mux = 10; -#endif - static Suite *tox_suite(void) { Suite *s = suite_create("Tox few clients"); - DEFTESTCASE_SLOW(few_clients, 8 * timeout_mux); + DEFTESTCASE(few_clients); return s; } diff --git a/auto_tests/toxav_many_test.c b/auto_tests/toxav_many_test.c index 9a639eb8697..02215098da1 100644 --- a/auto_tests/toxav_many_test.c +++ b/auto_tests/toxav_many_test.c @@ -341,10 +341,7 @@ static Suite *tox_suite(void) { Suite *s = suite_create("ToxAV"); - TCase *tc_av_three_calls = tcase_create("AV_three_calls"); - tcase_add_test(tc_av_three_calls, test_AV_three_calls); - tcase_set_timeout(tc_av_three_calls, 150); - suite_add_tcase(s, tc_av_three_calls); + DEFTESTCASE(AV_three_calls); return s; } diff --git a/circle.yml b/circle.yml index d0d2836c73c..18a834dbf25 100644 --- a/circle.yml +++ b/circle.yml @@ -16,7 +16,7 @@ dependencies: - sudo apt-get update - sudo apt-get install astyle/trusty-backports - sudo apt-get install clang - - sudo apt-get install build-essential libtool autotools-dev automake checkinstall check git yasm + - sudo apt-get install build-essential libtool autotools-dev automake checkinstall git yasm - sudo apt-get install libopus-dev libvpx-dev pkg-config # ------------ network_test requires that "localhost" resolves to ::1 ------------ diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index d2a52ae70a7..117bd1d50e1 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -21,9 +21,6 @@ pkg_use_module(VPX vpx ) # For tox-bootstrapd. pkg_use_module(LIBCONFIG libconfig ) -# For auto tests. -pkg_use_module(CHECK check ) - # For tox-spectest. pkg_use_module(MSGPACK msgpack ) @@ -39,7 +36,6 @@ pkg_use_module(SNDFILE sndfile ) # These require specific installation paths of dependencies: # - libsodium in libsodium/Win32/Release/v140/static # - pthreads in pthreads-win32/Pre-built.2 -# - check in %PROGRAMFILES%/check # ############################################################################### @@ -61,27 +57,6 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") message(FATAL_ERROR "libsodium libraries not found") endif() - # check - # ----- - # - # We look for the check and compat (containing clock_gettime and other POSIX - # functions not present on Windows) libraries in Program Files, since that is - # the default location where cmake installs its packages. - find_library(LIBCHECK_LIBRARIES - NAMES check libcheck - PATHS "$ENV{PROGRAMFILES}/check/lib" - ) - find_library(LIBCOMPAT_LIBRARIES - NAMES compat libcompat - PATHS "$ENV{PROGRAMFILES}/check/lib" - ) - if(LIBCHECK_LIBRARIES AND LIBCOMPAT_LIBRARIES) - include_directories("$ENV{PROGRAMFILES}/check/include") - set(CHECK_FOUND TRUE) - set(CHECK_LIBRARIES ${LIBCHECK_LIBRARIES} ${LIBCOMPAT_LIBRARIES}) - message("check: ${CHECK_LIBRARIES}") - endif() - # pthreads # -------- if(CMAKE_USE_WIN32_THREADS_INIT) diff --git a/configure.ac b/configure.ac index 18796bdde31..e094489fd55 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,6 @@ TOX_LOGGER="no" NCURSES_FOUND="no" LIBCONFIG_FOUND="no" -LIBCHECK_FOUND="no" WANT_NACL="no" ADD_NACL_OBJECTS_TO_PKGCONFIG="yes" SET_SO_VERSION="yes" @@ -525,17 +524,6 @@ if test "x$BUILD_AV" = "xyes"; then fi if test -n "$PKG_CONFIG"; then - if test "x$BUILD_TESTS" = "xyes"; then - PKG_CHECK_MODULES([CHECK], [check], - [ - LIBCHECK_FOUND="yes" - ], - [ - AC_MSG_WARN([libcheck not found, not building unit tests: $CHECK_PKG_ERRORS]) - BUILD_TESTS="no" - ]) - fi - if test "x$BUILD_DHT_BOOTSTRAP_DAEMON" = "xyes"; then PKG_CHECK_MODULES([LIBCONFIG], [libconfig >= 1.4.6], [ @@ -572,26 +560,6 @@ if (test "x$BUILD_DHT_BOOTSTRAP_DAEMON" = "xyes") && \ fi fi -if (test "x$BUILD_TESTS" = "xyes") && (test "x$LIBCHECK_FOUND" = "xno"); then - AC_CHECK_HEADER([check.h], - [], - [ - AC_MSG_WARN([header file for check library was not found on your system, unit tests will be disabled]) - BUILD_TESTS="no" - ] - ) - - if test "x$BUILD_TESTS" = "xyes"; then - AC_CHECK_LIB([check], [suite_create], - [], - [ - AC_MSG_WARN([library check was not found on the system, unit tests will be disabled]) - BUILD_TESTS="no" - ] - ) - fi -fi - if test "x$WIN32" = "xyes"; then AC_CHECK_LIB(ws2_32, main, [ diff --git a/other/bootstrap_daemon/docker/Dockerfile b/other/bootstrap_daemon/docker/Dockerfile index 500321c09bc..373f61c62ed 100644 --- a/other/bootstrap_daemon/docker/Dockerfile +++ b/other/bootstrap_daemon/docker/Dockerfile @@ -8,7 +8,6 @@ RUN export BUILD_PACKAGES="\ autotools-dev \ automake \ checkinstall \ - check \ git \ yasm \ libsodium-dev \ diff --git a/other/bootstrap_daemon/docker/Dockerfile.alpine b/other/bootstrap_daemon/docker/Dockerfile.alpine index f0b99bab213..48d9f44d670 100644 --- a/other/bootstrap_daemon/docker/Dockerfile.alpine +++ b/other/bootstrap_daemon/docker/Dockerfile.alpine @@ -20,7 +20,6 @@ RUN set -x && \ apk --no-cache add --virtual build-dependencies \ autoconf \ automake \ - check-dev \ curl \ build-base \ libtool \ diff --git a/other/docker/windows/Dockerfile b/other/docker/windows/Dockerfile index 176c39378e5..07903239463 100644 --- a/other/docker/windows/Dockerfile +++ b/other/docker/windows/Dockerfile @@ -4,7 +4,6 @@ FROM debian:stretch-slim ARG VERSION_SODIUM=1.0.16 ARG VERSION_OPUS=v1.2.1 ARG VERSION_VPX=v1.6.1 -ARG VERSION_CHECK=0.12.0 ARG SUPPORT_TEST=false ARG SUPPORT_ARCH_i686=true diff --git a/other/docker/windows/build_dependencies.sh b/other/docker/windows/build_dependencies.sh index f3d4b6033e8..43c6c3e12b3 100644 --- a/other/docker/windows/build_dependencies.sh +++ b/other/docker/windows/build_dependencies.sh @@ -59,18 +59,6 @@ build() make install cd .. - if [ "${SUPPORT_TEST}" = "true" ]; then - echo - echo "=== Building Check ${VERSION_CHECK} ${ARCH} ===" - git clone --depth=1 --branch="${VERSION_CHECK}" https://github.com/libcheck/check - cd check - autoreconf --install - ./configure --host="${WINDOWS_TOOLCHAIN}" --prefix="${EXTRA_PREFIX_DIR}" - make - make install - cd .. - fi - rm -rf /tmp/* } diff --git a/other/docker/windows/build_toxcore.sh b/other/docker/windows/build_toxcore.sh index 0f4c2731538..a38304554b6 100644 --- a/other/docker/windows/build_toxcore.sh +++ b/other/docker/windows/build_toxcore.sh @@ -17,7 +17,7 @@ build() # toxcore dependencies that we will copy to the user for static build of toxcore (e.g. vpx, opus, sodium) DEP_PREFIX_DIR="/root/prefix/${ARCH}" - # toxcore dependencies that user doesn't need in build result (e.g. libcheck used for testing toxcore) + # toxcore dependencies that user doesn't need in build result EXTRA_DEP_PREFIX_DIR="/root/extra-prefix/${ARCH}" mkdir -p "${EXTRA_DEP_PREFIX_DIR}" @@ -73,7 +73,7 @@ build() winecfg export CTEST_OUTPUT_ON_FAILURE=1 - # add libgcc_s_sjlj-1.dll libwinpthread-1.dll libcheck-0.dll into PATH env var of wine + # add libgcc_s_sjlj-1.dll libwinpthread-1.dll into PATH env var of wine export WINEPATH=`cd /usr/lib/gcc/${WINDOWS_TOOLCHAIN}/*posix/ ; winepath -w $(pwd)`\;`winepath -w /usr/${WINDOWS_TOOLCHAIN}/lib/`\;`winepath -w ${EXTRA_DEP_PREFIX_DIR}/bin` if [ "${ALLOW_TEST_FAILURE}" = "true" ]; then diff --git a/other/travis/freebsd-install-stage1 b/other/travis/freebsd-install-stage1 index 31544c447e4..46b403743e2 100755 --- a/other/travis/freebsd-install-stage1 +++ b/other/travis/freebsd-install-stage1 @@ -110,7 +110,6 @@ if [ ! -f ./$IMAGE_NAME.tgz ] || [ ! -f ./freebsd-install-stage1.sha256 ] || [ " gmake \ cmake \ pkgconf \ - check \ opencv \ portaudio \ libsndfile \ diff --git a/other/travis/toxcore-osx-install b/other/travis/toxcore-osx-install index 1c6daecc364..8f13cb5fd97 100755 --- a/other/travis/toxcore-osx-install +++ b/other/travis/toxcore-osx-install @@ -3,4 +3,4 @@ # Workaround for bug in Homebrew where it only finds an old Ruby version. brew update -brew install libsodium libvpx opus libconfig check astyle +brew install libsodium libvpx opus libconfig astyle