Don't include OpenSSL for core snippets

This commit is contained in:
Vinnie Falco
2018-12-14 07:27:46 -08:00
parent cf06a8dd6a
commit 49c5f7c30f
10 changed files with 32 additions and 23 deletions

View File

@@ -1,3 +1,9 @@
Version 200
* Don't include OpenSSL for core snippets
--------------------------------------------------------------------------------
Version 199: Version 199:
* Workarounds for msvc-14 * Workarounds for msvc-14

View File

@@ -19,7 +19,6 @@ add_executable (tests-beast-core
buffer_test.hpp buffer_test.hpp
file_test.hpp file_test.hpp
bind_handler.cpp bind_handler.cpp
buffer.cpp
buffer_traits.cpp buffer_traits.cpp
buffered_read_stream.cpp buffered_read_stream.cpp
buffers_adapter.cpp buffers_adapter.cpp
@@ -45,13 +44,14 @@ add_executable (tests-beast-core
static_buffer.cpp static_buffer.cpp
string_param.cpp string_param.cpp
type_traits.cpp type_traits.cpp
detail_base64.cpp
detail_buffer.cpp
detail_clamp.cpp
detail_read.cpp detail_read.cpp
detail_sha1.cpp
detail_tuple.cpp detail_tuple.cpp
detail/base64.cpp detail_variant.cpp
detail/clamp.cpp detail_varint.cpp
detail/sha1.cpp
detail/variant.cpp
detail/varint.cpp
) )
set_property(TARGET tests-beast-core PROPERTY FOLDER "tests") set_property(TARGET tests-beast-core PROPERTY FOLDER "tests")

View File

@@ -9,7 +9,6 @@
local SOURCES = local SOURCES =
bind_handler.cpp bind_handler.cpp
buffer.cpp
buffer_traits.cpp buffer_traits.cpp
buffered_read_stream.cpp buffered_read_stream.cpp
buffers_adapter.cpp buffers_adapter.cpp
@@ -35,13 +34,14 @@ local SOURCES =
string.cpp string.cpp
string_param.cpp string_param.cpp
type_traits.cpp type_traits.cpp
detail_base64.cpp
detail_buffer.cpp
detail_clamp.cpp
detail_read.cpp detail_read.cpp
detail_sha1.cpp
detail_tuple.cpp detail_tuple.cpp
detail/base64.cpp detail_variant.cpp
detail/clamp.cpp detail_varint.cpp
detail/sha1.cpp
detail/variant.cpp
detail/varint.cpp
; ;
local RUN_TESTS ; local RUN_TESTS ;

View File

@@ -19,11 +19,12 @@
namespace boost { namespace boost {
namespace beast { namespace beast {
namespace detail {
// VFALCO No idea why boost::system::errc::message_size fails // VFALCO No idea why boost::system::errc::message_size fails
// to compile, so we use net::error::eof instead. // to compile, so we use net::error::eof instead.
// //
class buffer_test : public beast::unit_test::suite class detail_buffer_test : public beast::unit_test::suite
{ {
public: public:
template<class DynamicBuffer> template<class DynamicBuffer>
@@ -33,18 +34,15 @@ public:
#ifndef BOOST_NO_EXCEPTIONS #ifndef BOOST_NO_EXCEPTIONS
error_code ec; error_code ec;
DynamicBuffer b(32); DynamicBuffer b(32);
detail::dynamic_buffer_prepare(b, 20, ec, dynamic_buffer_prepare(b, 20, ec,
//boost::system::errc::message_size);
net::error::eof); net::error::eof);
BEAST_EXPECTS(! ec, ec.message()); BEAST_EXPECTS(! ec, ec.message());
b.commit(20); b.commit(20);
auto const result = auto const result =
detail::dynamic_buffer_prepare(b, 20, ec, dynamic_buffer_prepare(b, 20, ec,
//boost::system::errc::message_size);
net::error::eof); net::error::eof);
BEAST_EXPECT(result == boost::none); BEAST_EXPECT(result == boost::none);
BEAST_EXPECTS( BEAST_EXPECTS(
//ec == boost::system::errc::message_size,
ec == net::error::eof, ec.message()); ec == net::error::eof, ec.message());
#else #else
fail("exceptions disabled", __FILE__, __LINE__); fail("exceptions disabled", __FILE__, __LINE__);
@@ -57,18 +55,15 @@ public:
{ {
error_code ec; error_code ec;
DynamicBuffer b(32); DynamicBuffer b(32);
detail::dynamic_buffer_prepare_noexcept(b, 20, ec, dynamic_buffer_prepare_noexcept(b, 20, ec,
//boost::system::errc::message_size);
net::error::eof); net::error::eof);
BEAST_EXPECTS(! ec, ec.message()); BEAST_EXPECTS(! ec, ec.message());
b.commit(20); b.commit(20);
auto const result = auto const result =
detail::dynamic_buffer_prepare_noexcept(b, 20, ec, detail::dynamic_buffer_prepare_noexcept(b, 20, ec,
//boost::system::errc::message_size);
net::error::eof); net::error::eof);
BEAST_EXPECT(result == boost::none); BEAST_EXPECT(result == boost::none);
BEAST_EXPECTS( BEAST_EXPECTS(
//ec == boost::system::errc::message_size,
ec == net::error::eof, ec.message()); ec == net::error::eof, ec.message());
} }
@@ -81,7 +76,8 @@ public:
} }
}; };
BEAST_DEFINE_TESTSUITE(beast,core,buffer); BEAST_DEFINE_TESTSUITE(beast,core,detail_buffer);
} // detail
} // beast } // beast
} // boost } // boost

View File

@@ -7,6 +7,13 @@
// Official repository: https://github.com/boostorg/beast // Official repository: https://github.com/boostorg/beast
// //
// prevent ssl.hpp from actually being included,
// otherwise we would need OpenSSL on AppVeyor
#ifndef BOOST_ASIO_SSL_HPP
#define BOOST_ASIO_SSL_HPP
namespace boost { namespace asio { namespace ssl { } } }
#endif
//[snippet_core_1a //[snippet_core_1a
#include <boost/beast/core.hpp> #include <boost/beast/core.hpp>