Commit 58b63667 authored by Simon Giesecke's avatar Simon Giesecke

Problem: on POSIX systems, all tests have a timeout of 60 seconds; disabling it…

Problem: on POSIX systems, all tests have a timeout of 60 seconds; disabling it via ZMQ_DISABLE_TEST_TIMEOUT doesn't work anymore

Solution: remove ZMQ_DISABLE_TEST_TIMEOUT guard but add default parameter to setup_test_environment
parent 577d64c0
...@@ -215,7 +215,7 @@ void close_zero_linger (void *socket_) ...@@ -215,7 +215,7 @@ void close_zero_linger (void *socket_)
TEST_ASSERT_SUCCESS_ERRNO (zmq_close (socket_)); TEST_ASSERT_SUCCESS_ERRNO (zmq_close (socket_));
} }
void setup_test_environment () void setup_test_environment (int timeout_seconds_)
{ {
#if defined _WIN32 #if defined _WIN32
#if defined _MSC_VER #if defined _MSC_VER
...@@ -228,10 +228,8 @@ void setup_test_environment () ...@@ -228,10 +228,8 @@ void setup_test_environment ()
// abort test after 121 seconds // abort test after 121 seconds
alarm (121); alarm (121);
#else #else
#if !defined ZMQ_DISABLE_TEST_TIMEOUT // abort test after timeout_seconds_ seconds
// abort test after 60 seconds alarm (timeout_seconds_);
alarm (60);
#endif
#endif #endif
#endif #endif
#if defined __MVS__ #if defined __MVS__
......
...@@ -144,7 +144,11 @@ void s_recv_seq (void *socket_, ...); ...@@ -144,7 +144,11 @@ void s_recv_seq (void *socket_, ...);
// Sets a zero linger period on a socket and closes it. // Sets a zero linger period on a socket and closes it.
void close_zero_linger (void *socket_); void close_zero_linger (void *socket_);
void setup_test_environment (void); // Setups the test environment. Must be called at the beginning of each test
// executable. On POSIX systems, it sets an alarm to the specified number of
// seconds, after which the test will be killed. Set to 0 to disable this
// timeout.
void setup_test_environment (int timeout_seconds_ = 60);
// Provide portable millisecond sleep // Provide portable millisecond sleep
// http://www.cplusplus.com/forum/unices/60161/ // http://www.cplusplus.com/forum/unices/60161/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment