Skip to content

Fix test failures in os x #534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libs/network/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@ if (Boost_FOUND)
${CPP-NETLIB_BINARY_DIR}/tests/cpp-netlib-${test})
endforeach (test)

# Also copy the server directory to the root of the build directory.
file(COPY server DESTINATION ${CPP-NETLIB_BINARY_DIR}/libs/network/test/)

endif()

9 changes: 7 additions & 2 deletions libs/network/test/http/client_get_timeout_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,25 @@
// http://www.boost.org/LICENSE_1_0.txt)

#define BOOST_TEST_MODULE HTTP Client Get Timeout Test
#include <cstdlib>
#include <boost/network/include/http/client.hpp>
#include <boost/test/unit_test.hpp>
#include "client_types.hpp"
#include "http_test_server.hpp"

struct localhost_server_fixture {
localhost_server_fixture() {
if (!server.start())
if (!server.start()) {
std::cout << "Failed to start HTTP server for test!" << std::endl;
std::abort();
}
}

~localhost_server_fixture() {
if (!server.stop())
if (!server.stop()) {
std::cout << "Failed to stop HTTP server for test!" << std::endl;
std::abort();
}
}

http_test_server server;
Expand Down