diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-05-25 19:35:52 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-05-29 16:05:23 -0700 |
| commit | 33dc5d611f578ace9833a80dc006a34b09da18af (patch) | |
| tree | 2351fd7d197530493dbd27034ae9e1546c2e299c /tests/CMakeLists.txt | |
| parent | fe5336ec1f9f27045f2c27ac253285c8447aa653 (diff) | |
| download | nng-33dc5d611f578ace9833a80dc006a34b09da18af.tar.gz nng-33dc5d611f578ace9833a80dc006a34b09da18af.tar.bz2 nng-33dc5d611f578ace9833a80dc006a34b09da18af.zip | |
fixes #484 crashes in websocket transport
fixes #490 posix_epdesc use-after-free bug
fixes #489 Sanitizer based testing would help
fixes #492 Numerous memory leaks found with sanitizer
This introduces support for compiler-based sanitizers when using
clang or gcc (and not on Windows). See NNG_SANITIZER for possible
settings such as "thread" or "address".
Furthermore, we have fixed the issues we found with both the
thread and address sanitizers. We believe that the thread issues
pointed to a low frequency use-after-free responsible for rare
crashes in some of the tests.
The tests generally have their timeouts doubled when running under
a sanitizer, to account for the extra long times that the sanitizer
can cause these to take.
While here, we also changed the compat_ws test to avoid a particularly
painful and time consuming DNS lookup, and we made the nngcat_unlimited
test a bit more robust by waiting before sending traffic.
Diffstat (limited to 'tests/CMakeLists.txt')
| -rw-r--r-- | tests/CMakeLists.txt | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9ba25882..4139c046 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -38,11 +38,17 @@ include_directories(AFTER SYSTEM ${PROJECT_SOURCE_DIR}/src) if (NNG_TESTS) + if (NOT NNG_SANITIZER STREQUAL "none") + set(TIMEOUT_FACTOR 2) + else() + set (TIMEOUT_FACTOR 1) + endif() set (NNG_TEST_PORT 13000) macro (add_nng_test NAME TIMEOUT) add_executable (${NAME} ${NAME}.c convey.c) target_link_libraries (${NAME} ${PROJECT_NAME} Threads::Threads) add_test (NAME ${NAME} COMMAND ${NAME} -v -p TEST_PORT=${NNG_TEST_PORT}) + math (EXPR TIMEOUT ${TIMEOUT}*${TIMEOUT_FACTOR}) set_tests_properties (${NAME} PROPERTIES TIMEOUT ${TIMEOUT}) math (EXPR NNG_TEST_PORT "${NNG_TEST_PORT}+20") endmacro (add_nng_test) @@ -181,21 +187,21 @@ add_nng_test2(surveypoll 5 NNG_PROTO_SURVEYOR0 NNG_PROTO_RESPONDENT0) # is because we don't want to make modifications to partially enable some # of these tests. Folks minimizing the library probably don't care too # much about these anyway. -add_nng_compat_test(compat_block 5) -add_nng_compat_test(compat_bug777 5) -add_nng_compat_test(compat_bus 5) -add_nng_compat_test(compat_cmsg 5) -add_nng_compat_test(compat_msg 5) -add_nng_compat_test(compat_iovec 5) -add_nng_compat_test(compat_device 5) -add_nng_compat_test(compat_pair 5) -add_nng_compat_test(compat_pipeline 5) -add_nng_compat_test(compat_poll 5) -add_nng_compat_test(compat_reqrep 5) -add_nng_compat_test(compat_survey 5) -add_nng_compat_test(compat_reqttl 5) -add_nng_compat_test(compat_shutdown 5) -add_nng_compat_test(compat_surveyttl 5) +add_nng_compat_test(compat_block 10) +add_nng_compat_test(compat_bug777 10) +add_nng_compat_test(compat_bus 10) +add_nng_compat_test(compat_cmsg 10) +add_nng_compat_test(compat_msg 10) +add_nng_compat_test(compat_iovec 10) +add_nng_compat_test(compat_device 10) +add_nng_compat_test(compat_pair 10) +add_nng_compat_test(compat_pipeline 10) +add_nng_compat_test(compat_poll 10) +add_nng_compat_test(compat_reqrep 10) +add_nng_compat_test(compat_survey 10) +add_nng_compat_test(compat_reqttl 10) +add_nng_compat_test(compat_shutdown 10) +add_nng_compat_test(compat_surveyttl 10) add_nng_compat_test(compat_tcp 60) add_nng_compat_test(compat_ws 60) |
