From 34849960489da7e79560e453be868e7d226179f0 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sat, 7 May 2016 14:57:15 -0400 Subject: [PATCH] Tidy up core sources: The core headers are moved to their own directory (but remain in the same namespace). --- CMakeLists.txt | 1 + doc/beast.dox | 1 + doc/quickref.xml | 3 +- doc/reference.xsl | 3 ++ examples/http_async_server.hpp | 2 +- examples/http_stream.hpp | 10 ++-- examples/http_stream.ipp | 4 +- examples/websocket_example.cpp | 2 +- extras/beast/test/fail_stream.hpp | 8 +-- extras/beast/test/string_stream.hpp | 8 +-- .../detail/const_container.hpp | 6 ++- extras/beast/unit_test/results.hpp | 10 ++-- extras/beast/unit_test/suite_list.hpp | 2 +- include/beast/core.hpp | 31 +++++++++++ include/beast/{ => core}/async_completion.hpp | 2 +- include/beast/{ => core}/basic_streambuf.hpp | 4 +- include/beast/{ => core}/bind_handler.hpp | 4 +- include/beast/{ => core}/buffer_cat.hpp | 2 +- include/beast/{ => core}/buffer_concepts.hpp | 2 +- include/beast/{ => core}/buffers_adapter.hpp | 4 +- .../beast/{ => core}/consuming_buffers.hpp | 4 +- include/beast/{ => core}/detail/base64.hpp | 0 .../beast/{ => core}/detail/bind_handler.hpp | 2 +- .../beast/{ => core}/detail/buffer_cat.hpp | 0 .../{ => core}/detail/buffer_concepts.hpp | 0 .../{ => core}/detail/ci_char_traits.hpp | 0 .../detail/empty_base_optimization.hpp | 0 .../{ => core}/detail/get_lowest_layer.hpp | 0 .../{ => core}/detail/integer_sequence.hpp | 0 .../{ => core}/detail/is_call_possible.hpp | 0 include/beast/{ => core}/detail/sha1.hpp | 0 .../{ => core}/detail/stream_concepts.hpp | 2 +- include/beast/{ => core}/detail/temp_dir.hpp | 0 include/beast/{ => core}/detail/unit_test.h | 0 .../{ => core}/detail/write_streambuf.hpp | 2 +- include/beast/{ => core}/error.hpp | 0 include/beast/{ => core}/handler_alloc.hpp | 0 include/beast/{ => core}/handler_concepts.hpp | 2 +- .../beast/{ => core}/impl/basic_streambuf.ipp | 2 +- .../beast/{ => core}/impl/buffers_adapter.ipp | 0 .../{ => core}/impl/consuming_buffers.ipp | 2 +- .../beast/{ => core}/impl/prepare_buffers.ipp | 0 .../{ => core}/impl/static_streambuf.ipp | 0 .../{ => core}/impl/streambuf_readstream.ipp | 8 +-- include/beast/{ => core}/placeholders.hpp | 0 include/beast/{ => core}/prepare_buffers.hpp | 2 +- include/beast/{ => core}/static_streambuf.hpp | 2 +- include/beast/{ => core}/static_string.hpp | 0 include/beast/{ => core}/stream_concepts.hpp | 2 +- include/beast/{ => core}/streambuf.hpp | 2 +- .../beast/{ => core}/streambuf_readstream.hpp | 13 ++--- include/beast/{ => core}/to_string.hpp | 2 +- include/beast/{ => core}/write_streambuf.hpp | 4 +- include/beast/http/basic_headers.hpp | 4 +- include/beast/http/body_type.hpp | 2 +- include/beast/http/empty_body.hpp | 2 +- include/beast/http/impl/basic_parser_v1.ipp | 2 +- include/beast/http/impl/read.ipp | 8 +-- include/beast/http/impl/write.ipp | 20 +++---- include/beast/http/parse_error.hpp | 2 +- include/beast/http/parser_v1.hpp | 2 +- include/beast/http/read.hpp | 4 +- include/beast/http/streambuf_body.hpp | 4 +- include/beast/http/string_body.hpp | 4 +- include/beast/http/type_check.hpp | 2 +- include/beast/http/write.hpp | 5 +- include/beast/websocket/detail/frame.hpp | 6 +-- include/beast/websocket/detail/hybi13.hpp | 4 +- .../beast/websocket/detail/stream_base.hpp | 4 +- include/beast/websocket/error.hpp | 2 +- include/beast/websocket/impl/accept_op.ipp | 4 +- include/beast/websocket/impl/close_op.ipp | 4 +- include/beast/websocket/impl/handshake_op.ipp | 2 +- .../beast/websocket/impl/read_frame_op.ipp | 6 +-- include/beast/websocket/impl/read_op.ipp | 2 +- include/beast/websocket/impl/response_op.ipp | 2 +- include/beast/websocket/impl/ssl.ipp | 4 +- include/beast/websocket/impl/stream.ipp | 14 ++--- include/beast/websocket/impl/teardown.ipp | 4 +- .../beast/websocket/impl/write_frame_op.ipp | 10 ++-- include/beast/websocket/impl/write_op.ipp | 6 +-- include/beast/websocket/rfc6455.hpp | 2 +- include/beast/websocket/stream.hpp | 6 +-- test/CMakeLists.txt | 25 +-------- test/Jamfile | 53 ++++++++++--------- test/core.cpp | 9 ++++ test/core/CMakeLists.txt | 36 +++++++++++++ test/{ => core}/async_completion.cpp | 2 +- test/{ => core}/basic_streambuf.cpp | 6 +-- test/{ => core}/bind_handler.cpp | 2 +- test/{ => core}/buffer_cat.cpp | 2 +- test/{ => core}/buffer_concepts.cpp | 2 +- test/{ => core}/buffers_adapter.cpp | 4 +- test/{ => core}/consuming_buffers.cpp | 2 +- test/{ => core}/detail/base64.cpp | 4 +- .../detail/empty_base_optimization.cpp | 4 +- test/{ => core}/detail/sha1.cpp | 2 +- test/{ => core}/error.cpp | 2 +- test/{ => core}/handler_alloc.cpp | 2 +- test/{ => core}/handler_concepts.cpp | 2 +- test/{ => core}/placeholders.cpp | 2 +- test/{ => core}/prepare_buffers.cpp | 4 +- test/{ => core}/static_streambuf.cpp | 2 +- test/{ => core}/static_string.cpp | 2 +- test/{ => core}/stream_concepts.cpp | 2 +- test/{ => core}/streambuf.cpp | 2 +- test/{ => core}/streambuf_readstream.cpp | 4 +- test/{ => core}/to_string.cpp | 2 +- test/{ => core}/write_streambuf.cpp | 5 +- test/http/CMakeLists.txt | 4 -- test/http/basic_parser_v1.cpp | 6 +-- test/http/message_fuzz.hpp | 2 +- test/http/message_v1.cpp | 4 +- test/http/nodejs_parser.hpp | 4 +- test/http/parser_bench.cpp | 5 +- test/http/write.cpp | 8 +-- test/websocket/stream.cpp | 4 +- test/websocket/utf8_checker.cpp | 2 +- test/websocket/websocket_async_echo_peer.hpp | 4 +- test/websocket/websocket_sync_echo_peer.hpp | 2 +- 120 files changed, 299 insertions(+), 233 deletions(-) rename extras/beast/{ => unit_test}/detail/const_container.hpp (92%) create mode 100644 include/beast/core.hpp rename include/beast/{ => core}/async_completion.hpp (98%) rename include/beast/{ => core}/basic_streambuf.hpp (98%) rename include/beast/{ => core}/bind_handler.hpp (95%) rename include/beast/{ => core}/buffer_cat.hpp (97%) rename include/beast/{ => core}/buffer_concepts.hpp (96%) rename include/beast/{ => core}/buffers_adapter.hpp (97%) rename include/beast/{ => core}/consuming_buffers.hpp (97%) rename include/beast/{ => core}/detail/base64.hpp (100%) rename include/beast/{ => core}/detail/bind_handler.hpp (98%) rename include/beast/{ => core}/detail/buffer_cat.hpp (100%) rename include/beast/{ => core}/detail/buffer_concepts.hpp (100%) rename include/beast/{ => core}/detail/ci_char_traits.hpp (100%) rename include/beast/{ => core}/detail/empty_base_optimization.hpp (100%) rename include/beast/{ => core}/detail/get_lowest_layer.hpp (100%) rename include/beast/{ => core}/detail/integer_sequence.hpp (100%) rename include/beast/{ => core}/detail/is_call_possible.hpp (100%) rename include/beast/{ => core}/detail/sha1.hpp (100%) rename include/beast/{ => core}/detail/stream_concepts.hpp (98%) rename include/beast/{ => core}/detail/temp_dir.hpp (100%) rename include/beast/{ => core}/detail/unit_test.h (100%) rename include/beast/{ => core}/detail/write_streambuf.hpp (98%) rename include/beast/{ => core}/error.hpp (100%) rename include/beast/{ => core}/handler_alloc.hpp (100%) rename include/beast/{ => core}/handler_concepts.hpp (93%) rename include/beast/{ => core}/impl/basic_streambuf.ipp (99%) rename include/beast/{ => core}/impl/buffers_adapter.ipp (100%) rename include/beast/{ => core}/impl/consuming_buffers.ipp (99%) rename include/beast/{ => core}/impl/prepare_buffers.ipp (100%) rename include/beast/{ => core}/impl/static_streambuf.ipp (100%) rename include/beast/{ => core}/impl/streambuf_readstream.ipp (97%) rename include/beast/{ => core}/placeholders.hpp (100%) rename include/beast/{ => core}/prepare_buffers.hpp (98%) rename include/beast/{ => core}/static_streambuf.hpp (98%) rename include/beast/{ => core}/static_string.hpp (100%) rename include/beast/{ => core}/stream_concepts.hpp (97%) rename include/beast/{ => core}/streambuf.hpp (94%) rename include/beast/{ => core}/streambuf_readstream.hpp (96%) rename include/beast/{ => core}/to_string.hpp (97%) rename include/beast/{ => core}/write_streambuf.hpp (95%) create mode 100644 test/core.cpp create mode 100644 test/core/CMakeLists.txt rename test/{ => core}/async_completion.cpp (86%) rename test/{ => core}/basic_streambuf.cpp (98%) rename test/{ => core}/bind_handler.cpp (94%) rename test/{ => core}/buffer_cat.cpp (98%) rename test/{ => core}/buffer_concepts.cpp (93%) rename test/{ => core}/buffers_adapter.cpp (98%) rename test/{ => core}/consuming_buffers.cpp (98%) rename test/{ => core}/detail/base64.cpp (91%) rename test/{ => core}/detail/empty_base_optimization.cpp (94%) rename test/{ => core}/detail/sha1.cpp (98%) rename test/{ => core}/error.cpp (89%) rename test/{ => core}/handler_alloc.cpp (94%) rename test/{ => core}/handler_concepts.cpp (92%) rename test/{ => core}/placeholders.cpp (87%) rename test/{ => core}/prepare_buffers.cpp (97%) rename test/{ => core}/static_streambuf.cpp (99%) rename test/{ => core}/static_string.cpp (99%) rename test/{ => core}/stream_concepts.cpp (96%) rename test/{ => core}/streambuf.cpp (88%) rename test/{ => core}/streambuf_readstream.cpp (93%) rename test/{ => core}/to_string.cpp (88%) rename test/{ => core}/write_streambuf.cpp (91%) diff --git a/CMakeLists.txt b/CMakeLists.txt index dab07e92..bd373e9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ file(GLOB_RECURSE BEAST_INCLUDES add_subdirectory (examples) add_subdirectory (test) +add_subdirectory (test/core) add_subdirectory (test/http) add_subdirectory (test/websocket) diff --git a/doc/beast.dox b/doc/beast.dox index 3861cf30..6e56005f 100644 --- a/doc/beast.dox +++ b/doc/beast.dox @@ -104,6 +104,7 @@ WARN_LOGFILE = #--------------------------------------------------------------------------- INPUT = \ ../include/beast/ \ + ../include/beast/core \ ../include/beast/http \ ../include/beast/websocket \ ../include/beast/doc_debug.hpp \ diff --git a/doc/quickref.xml b/doc/quickref.xml index 8e9337bd..20562e03 100644 --- a/doc/quickref.xml +++ b/doc/quickref.xml @@ -33,7 +33,6 @@ basic_parser_v1 basic_streambuf_body empty_body - error_code headers message resume_context @@ -119,6 +118,7 @@ basic_streambuf buffers_adapter consuming_buffers + error_code handler_alloc prepared_buffers static_streambuf @@ -126,6 +126,7 @@ static_string streambuf streambuf_readstream + system_error diff --git a/doc/reference.xsl b/doc/reference.xsl index cc0e9b5f..f57b3291 100644 --- a/doc/reference.xsl +++ b/doc/reference.xsl @@ -774,6 +774,9 @@ ] + + ['Convenience header: ][^beast/core.hpp] + ['Convenience header: ][^beast/http.hpp] diff --git a/examples/http_async_server.hpp b/examples/http_async_server.hpp index d0610f71..2a6108f2 100644 --- a/examples/http_async_server.hpp +++ b/examples/http_async_server.hpp @@ -23,7 +23,7 @@ #include "file_body.hpp" #include "http_stream.hpp" -#include +#include #include #include #include diff --git a/examples/http_stream.hpp b/examples/http_stream.hpp index 526ae4da..f02d9284 100644 --- a/examples/http_stream.hpp +++ b/examples/http_stream.hpp @@ -20,9 +20,9 @@ #ifndef BEAST_HTTP_STREAM_H_INCLUDED #define BEAST_HTTP_STREAM_H_INCLUDED +#include +#include #include -#include -#include #include #include #include @@ -234,7 +234,7 @@ public: error_code ec; cancel(ec); if(ec) - throw boost::system::system_error{ec}; + throw system_error{ec}; } /** Cancel pending operations. @@ -273,7 +273,7 @@ public: error_code ec; read(msg, ec); if(ec) - throw boost::system::system_error{ec}; + throw system_error{ec}; } /** Read a HTTP message from the stream. @@ -370,7 +370,7 @@ public: error_code ec; write(msg, ec); if(ec) - throw boost::system::system_error{ec}; + throw system_error{ec}; } /** Write a HTTP message to the stream. diff --git a/examples/http_stream.ipp b/examples/http_stream.ipp index 860d17a0..c9a23719 100644 --- a/examples/http_stream.ipp +++ b/examples/http_stream.ipp @@ -20,11 +20,11 @@ #ifndef BEAST_HTTP_STREAM_IPP_INCLUDED #define BEAST_HTTP_STREAM_IPP_INCLUDED +#include +#include #include #include #include -#include -#include #include namespace beast { diff --git a/examples/websocket_example.cpp b/examples/websocket_example.cpp index ac8c0a60..671af037 100644 --- a/examples/websocket_example.cpp +++ b/examples/websocket_example.cpp @@ -5,7 +5,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#include +#include #include #include #include diff --git a/extras/beast/test/fail_stream.hpp b/extras/beast/test/fail_stream.hpp index 622e7fb2..44081f75 100644 --- a/extras/beast/test/fail_stream.hpp +++ b/extras/beast/test/fail_stream.hpp @@ -20,11 +20,11 @@ #ifndef BEAST_TEST_FAIL_STREAM_HPP #define BEAST_TEST_FAIL_STREAM_HPP -#include -#include -#include +#include +#include +#include +#include #include -#include namespace beast { namespace test { diff --git a/extras/beast/test/string_stream.hpp b/extras/beast/test/string_stream.hpp index 6082f86b..5f44af14 100644 --- a/extras/beast/test/string_stream.hpp +++ b/extras/beast/test/string_stream.hpp @@ -8,8 +8,8 @@ #ifndef BEAST_TEST_STRING_STREAM_HPP #define BEAST_TEST_STRING_STREAM_HPP -#include -#include +#include +#include #include #include #include @@ -49,7 +49,7 @@ public: error_code ec; auto const n = read_some(buffers, ec); if(ec) - throw boost::system::system_error{ec}; + throw system_error{ec}; return n; } @@ -87,7 +87,7 @@ public: error_code ec; auto const n = write_some(buffers, ec); if(ec) - throw boost::system::system_error{ec}; + throw system_error{ec}; return n; } diff --git a/extras/beast/detail/const_container.hpp b/extras/beast/unit_test/detail/const_container.hpp similarity index 92% rename from extras/beast/detail/const_container.hpp rename to extras/beast/unit_test/detail/const_container.hpp index 72f2c32b..bf34318f 100644 --- a/extras/beast/detail/const_container.hpp +++ b/extras/beast/unit_test/detail/const_container.hpp @@ -5,10 +5,11 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BEAST_DETAIL_CONST_CONTAINER_HPP -#define BEAST_DETAIL_CONST_CONTAINER_HPP +#ifndef BEAST_UNIT_TEST_DETAIL_CONST_CONTAINER_HPP +#define BEAST_UNIT_TEST_DETAIL_CONST_CONTAINER_HPP namespace beast { +namespace unit_test { namespace detail { /** Adapter to constrain a container interface. @@ -84,6 +85,7 @@ public: }; } // detail +} // unit_test } // beast #endif diff --git a/extras/beast/unit_test/results.hpp b/extras/beast/unit_test/results.hpp index 74ebb76a..acc17108 100644 --- a/extras/beast/unit_test/results.hpp +++ b/extras/beast/unit_test/results.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_UNIT_TEST_RESULTS_HPP #define BEAST_UNIT_TEST_RESULTS_HPP -#include +#include #include #include @@ -40,7 +40,7 @@ public: private: class tests_t - : public beast::detail::const_container > + : public detail::const_container > { private: std::size_t failed_; @@ -82,7 +82,7 @@ private: }; class log_t - : public beast::detail::const_container > + : public detail::const_container > { public: /** Insert a string into the log. */ @@ -119,7 +119,7 @@ public: /** Holds the set of testcase results in a suite. */ class suite_results - : public beast::detail::const_container > + : public detail::const_container > { private: std::string name_; @@ -178,7 +178,7 @@ public: // VFALCO TODO Make this a template class using scoped allocators /** Holds the results of running a set of testsuites. */ class results - : public beast::detail::const_container > + : public detail::const_container > { private: std::size_t m_cases; diff --git a/extras/beast/unit_test/suite_list.hpp b/extras/beast/unit_test/suite_list.hpp index 48d2f6e2..5feacf26 100644 --- a/extras/beast/unit_test/suite_list.hpp +++ b/extras/beast/unit_test/suite_list.hpp @@ -9,7 +9,7 @@ #define BEAST_UNIT_TEST_SUITE_LIST_HPP #include -#include +#include #include #include #include diff --git a/include/beast/core.hpp b/include/beast/core.hpp new file mode 100644 index 00000000..26eb9cd7 --- /dev/null +++ b/include/beast/core.hpp @@ -0,0 +1,31 @@ +// +// Copyright (c) 2013-2016 Vinnie Falco (vinnie dot falco at gmail dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef BEAST_CORE_HPP +#define BEAST_CORE_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/beast/async_completion.hpp b/include/beast/core/async_completion.hpp similarity index 98% rename from include/beast/async_completion.hpp rename to include/beast/core/async_completion.hpp index ab659326..51c2e290 100644 --- a/include/beast/async_completion.hpp +++ b/include/beast/core/async_completion.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_ASYNC_COMPLETION_HPP #define BEAST_ASYNC_COMPLETION_HPP -#include +#include #include #include #include diff --git a/include/beast/basic_streambuf.hpp b/include/beast/core/basic_streambuf.hpp similarity index 98% rename from include/beast/basic_streambuf.hpp rename to include/beast/core/basic_streambuf.hpp index f81bdcc1..b48a6d0f 100644 --- a/include/beast/basic_streambuf.hpp +++ b/include/beast/core/basic_streambuf.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_BASIC_STREAMBUF_HPP #define BEAST_BASIC_STREAMBUF_HPP -#include +#include #include #include #include @@ -298,6 +298,6 @@ operator<<(basic_streambuf& streambuf, T const& t); } // beast -#include +#include #endif diff --git a/include/beast/bind_handler.hpp b/include/beast/core/bind_handler.hpp similarity index 95% rename from include/beast/bind_handler.hpp rename to include/beast/core/bind_handler.hpp index 103a3994..b01365e7 100644 --- a/include/beast/bind_handler.hpp +++ b/include/beast/core/bind_handler.hpp @@ -8,8 +8,8 @@ #ifndef BEAST_BIND_HANDLER_HPP #define BEAST_BIND_HANDLER_HPP -#include -#include +#include +#include #include #include diff --git a/include/beast/buffer_cat.hpp b/include/beast/core/buffer_cat.hpp similarity index 97% rename from include/beast/buffer_cat.hpp rename to include/beast/core/buffer_cat.hpp index 5c3fabb4..dee9c3c8 100644 --- a/include/beast/buffer_cat.hpp +++ b/include/beast/core/buffer_cat.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_BUFFER_CAT_HPP #define BEAST_BUFFER_CAT_HPP -#include +#include #include #include #include diff --git a/include/beast/buffer_concepts.hpp b/include/beast/core/buffer_concepts.hpp similarity index 96% rename from include/beast/buffer_concepts.hpp rename to include/beast/core/buffer_concepts.hpp index 240834fa..f99d716b 100644 --- a/include/beast/buffer_concepts.hpp +++ b/include/beast/core/buffer_concepts.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_BUFFER_CONCEPTS_HPP #define BEAST_BUFFER_CONCEPTS_HPP -#include +#include #include #include diff --git a/include/beast/buffers_adapter.hpp b/include/beast/core/buffers_adapter.hpp similarity index 97% rename from include/beast/buffers_adapter.hpp rename to include/beast/core/buffers_adapter.hpp index 3a0677c3..fa116a29 100644 --- a/include/beast/buffers_adapter.hpp +++ b/include/beast/core/buffers_adapter.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_BUFFERS_ADAPTER_HPP #define BEAST_BUFFERS_ADAPTER_HPP -#include +#include #include #include @@ -145,6 +145,6 @@ public: } // beast -#include +#include #endif diff --git a/include/beast/consuming_buffers.hpp b/include/beast/core/consuming_buffers.hpp similarity index 97% rename from include/beast/consuming_buffers.hpp rename to include/beast/core/consuming_buffers.hpp index 32864d5e..a467e171 100644 --- a/include/beast/consuming_buffers.hpp +++ b/include/beast/core/consuming_buffers.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_CONSUMING_BUFFERS_HPP #define BEAST_CONSUMING_BUFFERS_HPP -#include +#include #include #include #include @@ -135,6 +135,6 @@ consumed_buffers(BufferSequence const& buffers, std::size_t n); } // beast -#include +#include #endif diff --git a/include/beast/detail/base64.hpp b/include/beast/core/detail/base64.hpp similarity index 100% rename from include/beast/detail/base64.hpp rename to include/beast/core/detail/base64.hpp diff --git a/include/beast/detail/bind_handler.hpp b/include/beast/core/detail/bind_handler.hpp similarity index 98% rename from include/beast/detail/bind_handler.hpp rename to include/beast/core/detail/bind_handler.hpp index 4caba66d..849ab619 100644 --- a/include/beast/detail/bind_handler.hpp +++ b/include/beast/core/detail/bind_handler.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_BIND_DETAIL_HANDLER_HPP #define BEAST_BIND_DETAIL_HANDLER_HPP -#include +#include #include #include #include diff --git a/include/beast/detail/buffer_cat.hpp b/include/beast/core/detail/buffer_cat.hpp similarity index 100% rename from include/beast/detail/buffer_cat.hpp rename to include/beast/core/detail/buffer_cat.hpp diff --git a/include/beast/detail/buffer_concepts.hpp b/include/beast/core/detail/buffer_concepts.hpp similarity index 100% rename from include/beast/detail/buffer_concepts.hpp rename to include/beast/core/detail/buffer_concepts.hpp diff --git a/include/beast/detail/ci_char_traits.hpp b/include/beast/core/detail/ci_char_traits.hpp similarity index 100% rename from include/beast/detail/ci_char_traits.hpp rename to include/beast/core/detail/ci_char_traits.hpp diff --git a/include/beast/detail/empty_base_optimization.hpp b/include/beast/core/detail/empty_base_optimization.hpp similarity index 100% rename from include/beast/detail/empty_base_optimization.hpp rename to include/beast/core/detail/empty_base_optimization.hpp diff --git a/include/beast/detail/get_lowest_layer.hpp b/include/beast/core/detail/get_lowest_layer.hpp similarity index 100% rename from include/beast/detail/get_lowest_layer.hpp rename to include/beast/core/detail/get_lowest_layer.hpp diff --git a/include/beast/detail/integer_sequence.hpp b/include/beast/core/detail/integer_sequence.hpp similarity index 100% rename from include/beast/detail/integer_sequence.hpp rename to include/beast/core/detail/integer_sequence.hpp diff --git a/include/beast/detail/is_call_possible.hpp b/include/beast/core/detail/is_call_possible.hpp similarity index 100% rename from include/beast/detail/is_call_possible.hpp rename to include/beast/core/detail/is_call_possible.hpp diff --git a/include/beast/detail/sha1.hpp b/include/beast/core/detail/sha1.hpp similarity index 100% rename from include/beast/detail/sha1.hpp rename to include/beast/core/detail/sha1.hpp diff --git a/include/beast/detail/stream_concepts.hpp b/include/beast/core/detail/stream_concepts.hpp similarity index 98% rename from include/beast/detail/stream_concepts.hpp rename to include/beast/core/detail/stream_concepts.hpp index a329ac44..39edcced 100644 --- a/include/beast/detail/stream_concepts.hpp +++ b/include/beast/core/detail/stream_concepts.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_DETAIL_STREAM_CONCEPTS_HPP #define BEAST_DETAIL_STREAM_CONCEPTS_HPP -#include +#include #include #include #include diff --git a/include/beast/detail/temp_dir.hpp b/include/beast/core/detail/temp_dir.hpp similarity index 100% rename from include/beast/detail/temp_dir.hpp rename to include/beast/core/detail/temp_dir.hpp diff --git a/include/beast/detail/unit_test.h b/include/beast/core/detail/unit_test.h similarity index 100% rename from include/beast/detail/unit_test.h rename to include/beast/core/detail/unit_test.h diff --git a/include/beast/detail/write_streambuf.hpp b/include/beast/core/detail/write_streambuf.hpp similarity index 98% rename from include/beast/detail/write_streambuf.hpp rename to include/beast/core/detail/write_streambuf.hpp index 06174242..347d1954 100644 --- a/include/beast/detail/write_streambuf.hpp +++ b/include/beast/core/detail/write_streambuf.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_DETAIL_WRITE_STREAMBUF_HPP #define BEAST_DETAIL_WRITE_STREAMBUF_HPP -#include +#include #include #include #include diff --git a/include/beast/error.hpp b/include/beast/core/error.hpp similarity index 100% rename from include/beast/error.hpp rename to include/beast/core/error.hpp diff --git a/include/beast/handler_alloc.hpp b/include/beast/core/handler_alloc.hpp similarity index 100% rename from include/beast/handler_alloc.hpp rename to include/beast/core/handler_alloc.hpp diff --git a/include/beast/handler_concepts.hpp b/include/beast/core/handler_concepts.hpp similarity index 93% rename from include/beast/handler_concepts.hpp rename to include/beast/core/handler_concepts.hpp index e0a4a89e..33c43f07 100644 --- a/include/beast/handler_concepts.hpp +++ b/include/beast/core/handler_concepts.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_HANDLER_CONCEPTS_HPP #define BEAST_HANDLER_CONCEPTS_HPP -#include +#include #include namespace beast { diff --git a/include/beast/impl/basic_streambuf.ipp b/include/beast/core/impl/basic_streambuf.ipp similarity index 99% rename from include/beast/impl/basic_streambuf.ipp rename to include/beast/core/impl/basic_streambuf.ipp index ce073e26..90f39b53 100644 --- a/include/beast/impl/basic_streambuf.ipp +++ b/include/beast/core/impl/basic_streambuf.ipp @@ -8,7 +8,7 @@ #ifndef BEAST_IMPL_BASIC_STREAMBUF_IPP #define BEAST_IMPL_BASIC_STREAMBUF_IPP -#include +#include #include #include #include diff --git a/include/beast/impl/buffers_adapter.ipp b/include/beast/core/impl/buffers_adapter.ipp similarity index 100% rename from include/beast/impl/buffers_adapter.ipp rename to include/beast/core/impl/buffers_adapter.ipp diff --git a/include/beast/impl/consuming_buffers.ipp b/include/beast/core/impl/consuming_buffers.ipp similarity index 99% rename from include/beast/impl/consuming_buffers.ipp rename to include/beast/core/impl/consuming_buffers.ipp index 748892e2..37c69005 100644 --- a/include/beast/impl/consuming_buffers.ipp +++ b/include/beast/core/impl/consuming_buffers.ipp @@ -8,7 +8,7 @@ #ifndef BEAST_IMPL_CONSUMING_BUFFERS_IPP #define BEAST_IMPL_CONSUMING_BUFFERS_IPP -#include +#include #include #include #include diff --git a/include/beast/impl/prepare_buffers.ipp b/include/beast/core/impl/prepare_buffers.ipp similarity index 100% rename from include/beast/impl/prepare_buffers.ipp rename to include/beast/core/impl/prepare_buffers.ipp diff --git a/include/beast/impl/static_streambuf.ipp b/include/beast/core/impl/static_streambuf.ipp similarity index 100% rename from include/beast/impl/static_streambuf.ipp rename to include/beast/core/impl/static_streambuf.ipp diff --git a/include/beast/impl/streambuf_readstream.ipp b/include/beast/core/impl/streambuf_readstream.ipp similarity index 97% rename from include/beast/impl/streambuf_readstream.ipp rename to include/beast/core/impl/streambuf_readstream.ipp index 679cf5bb..f65f85f7 100644 --- a/include/beast/impl/streambuf_readstream.ipp +++ b/include/beast/core/impl/streambuf_readstream.ipp @@ -8,9 +8,9 @@ #ifndef BEAST_IMPL_STREAMBUF_READSTREAM_IPP #define BEAST_IMPL_STREAMBUF_READSTREAM_IPP -#include -#include -#include +#include +#include +#include #include #include @@ -199,7 +199,7 @@ read_some( error_code ec; auto n = read_some(buffers, ec); if(ec) - throw boost::system::system_error{ec}; + throw system_error{ec}; return n; } diff --git a/include/beast/placeholders.hpp b/include/beast/core/placeholders.hpp similarity index 100% rename from include/beast/placeholders.hpp rename to include/beast/core/placeholders.hpp diff --git a/include/beast/prepare_buffers.hpp b/include/beast/core/prepare_buffers.hpp similarity index 98% rename from include/beast/prepare_buffers.hpp rename to include/beast/core/prepare_buffers.hpp index cb3a0099..9b113ae3 100644 --- a/include/beast/prepare_buffers.hpp +++ b/include/beast/core/prepare_buffers.hpp @@ -152,6 +152,6 @@ prepare_buffers(std::size_t n, BufferSequence const& buffers); } // beast -#include +#include #endif diff --git a/include/beast/static_streambuf.hpp b/include/beast/core/static_streambuf.hpp similarity index 98% rename from include/beast/static_streambuf.hpp rename to include/beast/core/static_streambuf.hpp index add19212..07fa4fc1 100644 --- a/include/beast/static_streambuf.hpp +++ b/include/beast/core/static_streambuf.hpp @@ -184,6 +184,6 @@ public: } // beast -#include +#include #endif diff --git a/include/beast/static_string.hpp b/include/beast/core/static_string.hpp similarity index 100% rename from include/beast/static_string.hpp rename to include/beast/core/static_string.hpp diff --git a/include/beast/stream_concepts.hpp b/include/beast/core/stream_concepts.hpp similarity index 97% rename from include/beast/stream_concepts.hpp rename to include/beast/core/stream_concepts.hpp index ec07f0f3..a93a7f10 100644 --- a/include/beast/stream_concepts.hpp +++ b/include/beast/core/stream_concepts.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_STREAM_CONCEPTS_HPP #define BEAST_STREAM_CONCEPTS_HPP -#include +#include #include namespace beast { diff --git a/include/beast/streambuf.hpp b/include/beast/core/streambuf.hpp similarity index 94% rename from include/beast/streambuf.hpp rename to include/beast/core/streambuf.hpp index cc30b817..468c8dfa 100644 --- a/include/beast/streambuf.hpp +++ b/include/beast/core/streambuf.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_STREAMBUF_HPP #define BEAST_STREAMBUF_HPP -#include +#include namespace beast { diff --git a/include/beast/streambuf_readstream.hpp b/include/beast/core/streambuf_readstream.hpp similarity index 96% rename from include/beast/streambuf_readstream.hpp rename to include/beast/core/streambuf_readstream.hpp index 75c0d5bc..7557fcc3 100644 --- a/include/beast/streambuf_readstream.hpp +++ b/include/beast/core/streambuf_readstream.hpp @@ -8,11 +8,12 @@ #ifndef BEAST_STREAMBUF_READSTREAM_HPP #define BEAST_STREAMBUF_READSTREAM_HPP -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -276,6 +277,6 @@ public: } // beast -#include +#include #endif diff --git a/include/beast/to_string.hpp b/include/beast/core/to_string.hpp similarity index 97% rename from include/beast/to_string.hpp rename to include/beast/core/to_string.hpp index 711483cd..41ba8d0f 100644 --- a/include/beast/to_string.hpp +++ b/include/beast/core/to_string.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_TO_STRING_HPP #define BEAST_TO_STRING_HPP -#include +#include #include #include diff --git a/include/beast/write_streambuf.hpp b/include/beast/core/write_streambuf.hpp similarity index 95% rename from include/beast/write_streambuf.hpp rename to include/beast/core/write_streambuf.hpp index 24dc61a0..07e7d809 100644 --- a/include/beast/write_streambuf.hpp +++ b/include/beast/core/write_streambuf.hpp @@ -8,8 +8,8 @@ #ifndef BEAST_WRITE_STREAMBUF_HPP #define BEAST_WRITE_STREAMBUF_HPP -#include -#include +#include +#include #include #include diff --git a/include/beast/http/basic_headers.hpp b/include/beast/http/basic_headers.hpp index 78e8b1e0..6e034e27 100644 --- a/include/beast/http/basic_headers.hpp +++ b/include/beast/http/basic_headers.hpp @@ -8,8 +8,8 @@ #ifndef BEAST_HTTP_BASIC_HEADERS_HPP #define BEAST_HTTP_BASIC_HEADERS_HPP -#include -#include +#include +#include #include #include #include diff --git a/include/beast/http/body_type.hpp b/include/beast/http/body_type.hpp index 4a71cff3..5b3f9601 100644 --- a/include/beast/http/body_type.hpp +++ b/include/beast/http/body_type.hpp @@ -11,7 +11,7 @@ // Convenience header to include everything // needed when declarating a user defined Body type. -#include +#include #include #include #include diff --git a/include/beast/http/empty_body.hpp b/include/beast/http/empty_body.hpp index 7ac6d06a..885a5605 100644 --- a/include/beast/http/empty_body.hpp +++ b/include/beast/http/empty_body.hpp @@ -9,7 +9,7 @@ #define BEAST_HTTP_EMPTY_BODY_HPP #include -#include +#include #include #include #include diff --git a/include/beast/http/impl/basic_parser_v1.ipp b/include/beast/http/impl/basic_parser_v1.ipp index fd904944..baf9127c 100644 --- a/include/beast/http/impl/basic_parser_v1.ipp +++ b/include/beast/http/impl/basic_parser_v1.ipp @@ -8,7 +8,7 @@ #ifndef BEAST_HTTP_IMPL_BASIC_PARSER_V1_IPP #define BEAST_HTTP_IMPL_BASIC_PARSER_V1_IPP -#include +#include namespace beast { namespace http { diff --git a/include/beast/http/impl/read.ipp b/include/beast/http/impl/read.ipp index 3a3465c4..a09da41c 100644 --- a/include/beast/http/impl/read.ipp +++ b/include/beast/http/impl/read.ipp @@ -9,9 +9,9 @@ #define BEAST_HTTP_IMPL_READ_IPP_HPP #include -#include -#include -#include +#include +#include +#include #include namespace beast { @@ -221,7 +221,7 @@ read(SyncReadStream& stream, Streambuf& streambuf, error_code ec; read(stream, streambuf, msg, ec); if(ec) - throw boost::system::system_error{ec}; + throw system_error{ec}; } template #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -451,7 +451,7 @@ write(SyncWriteStream& stream, error_code ec; write(stream, msg, ec); if(ec) - throw boost::system::system_error{ec}; + throw system_error{ec}; } template +#include namespace beast { namespace http { diff --git a/include/beast/http/parser_v1.hpp b/include/beast/http/parser_v1.hpp index b699eacd..7966ee45 100644 --- a/include/beast/http/parser_v1.hpp +++ b/include/beast/http/parser_v1.hpp @@ -8,9 +8,9 @@ #ifndef BEAST_HTTP_PARSER_V1_HPP #define BEAST_HTTP_PARSER_V1_HPP -#include #include #include +#include #include #include #include diff --git a/include/beast/http/read.hpp b/include/beast/http/read.hpp index 6927cefe..9c80ce58 100644 --- a/include/beast/http/read.hpp +++ b/include/beast/http/read.hpp @@ -8,9 +8,9 @@ #ifndef BEAST_HTTP_READ_HPP #define BEAST_HTTP_READ_HPP -#include #include -#include +#include +#include #include #include diff --git a/include/beast/http/streambuf_body.hpp b/include/beast/http/streambuf_body.hpp index 005caa48..faadf1c1 100644 --- a/include/beast/http/streambuf_body.hpp +++ b/include/beast/http/streambuf_body.hpp @@ -9,8 +9,8 @@ #define BEAST_HTTP_STREAMBUF_BODY_HPP #include -#include -#include +#include +#include #include #include diff --git a/include/beast/http/string_body.hpp b/include/beast/http/string_body.hpp index fa5ec654..c69a626d 100644 --- a/include/beast/http/string_body.hpp +++ b/include/beast/http/string_body.hpp @@ -9,8 +9,8 @@ #define BEAST_HTTP_STRING_BODY_HPP #include -#include -#include +#include +#include #include #include diff --git a/include/beast/http/type_check.hpp b/include/beast/http/type_check.hpp index e83074c8..67fe1488 100644 --- a/include/beast/http/type_check.hpp +++ b/include/beast/http/type_check.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_HTTP_TYPE_CHECK_HPP #define BEAST_HTTP_TYPE_CHECK_HPP -#include +#include #include #include #include diff --git a/include/beast/http/write.hpp b/include/beast/http/write.hpp index bf48a080..9a79f313 100644 --- a/include/beast/http/write.hpp +++ b/include/beast/http/write.hpp @@ -8,10 +8,9 @@ #ifndef BEAST_HTTP_WRITE_HPP #define BEAST_HTTP_WRITE_HPP -#include #include -#include -#include +#include +#include #include #include diff --git a/include/beast/websocket/detail/frame.hpp b/include/beast/websocket/detail/frame.hpp index f23aa63e..470c46cb 100644 --- a/include/beast/websocket/detail/frame.hpp +++ b/include/beast/websocket/detail/frame.hpp @@ -11,9 +11,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/include/beast/websocket/detail/hybi13.hpp b/include/beast/websocket/detail/hybi13.hpp index 831469c8..154e8582 100644 --- a/include/beast/websocket/detail/hybi13.hpp +++ b/include/beast/websocket/detail/hybi13.hpp @@ -8,8 +8,8 @@ #ifndef BEAST_WEBSOCKET_DETAIL_HYBI13_HPP #define BEAST_WEBSOCKET_DETAIL_HYBI13_HPP -#include -#include +#include +#include #include #include #include diff --git a/include/beast/websocket/detail/stream_base.hpp b/include/beast/websocket/detail/stream_base.hpp index 23e5c8e7..112205f7 100644 --- a/include/beast/websocket/detail/stream_base.hpp +++ b/include/beast/websocket/detail/stream_base.hpp @@ -15,10 +15,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include @@ -36,7 +36,7 @@ void maybe_throw(error_code const& ec, String const&) { if(ec) - throw boost::system::system_error{ec}; + throw system_error{ec}; } template diff --git a/include/beast/websocket/error.hpp b/include/beast/websocket/error.hpp index 64b6a63a..d2265833 100644 --- a/include/beast/websocket/error.hpp +++ b/include/beast/websocket/error.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_WEBSOCKET_ERROR_HPP #define BEAST_WEBSOCKET_ERROR_HPP -#include +#include namespace beast { namespace websocket { diff --git a/include/beast/websocket/impl/accept_op.ipp b/include/beast/websocket/impl/accept_op.ipp index 87b3f223..b897832c 100644 --- a/include/beast/websocket/impl/accept_op.ipp +++ b/include/beast/websocket/impl/accept_op.ipp @@ -12,8 +12,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/include/beast/websocket/impl/close_op.ipp b/include/beast/websocket/impl/close_op.ipp index 9b59413f..4573cb41 100644 --- a/include/beast/websocket/impl/close_op.ipp +++ b/include/beast/websocket/impl/close_op.ipp @@ -8,8 +8,8 @@ #ifndef BEAST_WEBSOCKET_IMPL_CLOSE_OP_HPP #define BEAST_WEBSOCKET_IMPL_CLOSE_OP_HPP -#include -#include +#include +#include #include namespace beast { diff --git a/include/beast/websocket/impl/handshake_op.ipp b/include/beast/websocket/impl/handshake_op.ipp index 64725166..e126c6a0 100644 --- a/include/beast/websocket/impl/handshake_op.ipp +++ b/include/beast/websocket/impl/handshake_op.ipp @@ -8,11 +8,11 @@ #ifndef BEAST_WEBSOCKET_IMPL_HANDSHAKE_OP_HPP #define BEAST_WEBSOCKET_IMPL_HANDSHAKE_OP_HPP -#include #include #include #include #include +#include #include #include diff --git a/include/beast/websocket/impl/read_frame_op.ipp b/include/beast/websocket/impl/read_frame_op.ipp index 33acc90f..44c7f39b 100644 --- a/include/beast/websocket/impl/read_frame_op.ipp +++ b/include/beast/websocket/impl/read_frame_op.ipp @@ -9,9 +9,9 @@ #define BEAST_WEBSOCKET_IMPL_READ_FRAME_OP_HPP #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/include/beast/websocket/impl/read_op.ipp b/include/beast/websocket/impl/read_op.ipp index 8ea86893..514fb714 100644 --- a/include/beast/websocket/impl/read_op.ipp +++ b/include/beast/websocket/impl/read_op.ipp @@ -8,7 +8,7 @@ #ifndef BEAST_WEBSOCKET_IMPL_READ_OP_HPP #define BEAST_WEBSOCKET_IMPL_READ_OP_HPP -#include +#include #include namespace beast { diff --git a/include/beast/websocket/impl/response_op.ipp b/include/beast/websocket/impl/response_op.ipp index 578cdb67..98287940 100644 --- a/include/beast/websocket/impl/response_op.ipp +++ b/include/beast/websocket/impl/response_op.ipp @@ -8,10 +8,10 @@ #ifndef BEAST_WEBSOCKET_IMPL_RESPONSE_OP_HPP #define BEAST_WEBSOCKET_IMPL_RESPONSE_OP_HPP -#include #include #include #include +#include #include namespace beast { diff --git a/include/beast/websocket/impl/ssl.ipp b/include/beast/websocket/impl/ssl.ipp index 5dd93b04..681ecd34 100644 --- a/include/beast/websocket/impl/ssl.ipp +++ b/include/beast/websocket/impl/ssl.ipp @@ -8,8 +8,8 @@ #ifndef BEAST_WEBSOCKET_IMPL_SSL_IPP_INCLUDED #define BEAST_WEBSOCKET_IMPL_SSL_IPP_INCLUDED -#include -#include +#include +#include namespace beast { namespace websocket { diff --git a/include/beast/websocket/impl/stream.ipp b/include/beast/websocket/impl/stream.ipp index 6e85da2d..aa154fc3 100644 --- a/include/beast/websocket/impl/stream.ipp +++ b/include/beast/websocket/impl/stream.ipp @@ -22,13 +22,13 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/include/beast/websocket/impl/teardown.ipp b/include/beast/websocket/impl/teardown.ipp index 4997842c..41daef59 100644 --- a/include/beast/websocket/impl/teardown.ipp +++ b/include/beast/websocket/impl/teardown.ipp @@ -8,8 +8,8 @@ #ifndef BEAST_WEBSOCKET_IMPL_TEARDOWN_IPP #define BEAST_WEBSOCKET_IMPL_TEARDOWN_IPP -#include -#include +#include +#include #include namespace beast { diff --git a/include/beast/websocket/impl/write_frame_op.ipp b/include/beast/websocket/impl/write_frame_op.ipp index 4ca67056..7cc100ad 100644 --- a/include/beast/websocket/impl/write_frame_op.ipp +++ b/include/beast/websocket/impl/write_frame_op.ipp @@ -8,11 +8,11 @@ #ifndef BEAST_WEBSOCKET_IMPL_WRITE_FRAME_OP_HPP #define BEAST_WEBSOCKET_IMPL_WRITE_FRAME_OP_HPP -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include diff --git a/include/beast/websocket/impl/write_op.ipp b/include/beast/websocket/impl/write_op.ipp index 308eab5e..0bbcea25 100644 --- a/include/beast/websocket/impl/write_op.ipp +++ b/include/beast/websocket/impl/write_op.ipp @@ -8,9 +8,9 @@ #ifndef BEAST_WEBSOCKET_IMPL_WRITE_OP_HPP #define BEAST_WEBSOCKET_IMPL_WRITE_OP_HPP -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/include/beast/websocket/rfc6455.hpp b/include/beast/websocket/rfc6455.hpp index 00834be8..49ed2fe0 100644 --- a/include/beast/websocket/rfc6455.hpp +++ b/include/beast/websocket/rfc6455.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_WEBSOCKET_RFC6455_HPP #define BEAST_WEBSOCKET_RFC6455_HPP -#include +#include #include #include #include diff --git a/include/beast/websocket/stream.hpp b/include/beast/websocket/stream.hpp index 82412ebf..a868a88f 100644 --- a/include/beast/websocket/stream.hpp +++ b/include/beast/websocket/stream.hpp @@ -12,9 +12,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 603fa573..1b4a4a42 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,34 +4,13 @@ GroupSources(extras/beast beast) GroupSources(include/beast beast) GroupSources(test "/") -add_executable (core-tests +add_executable (lib-tests ${BEAST_INCLUDES} ../extras/beast/unit_test/main.cpp - async_completion.cpp - basic_streambuf.cpp - bind_handler.cpp - buffer_cat.cpp - buffer_concepts.cpp - buffers_adapter.cpp - consuming_buffers.cpp - error.cpp - handler_alloc.cpp - handler_concepts.cpp + core.cpp http.cpp - placeholders.cpp - prepare_buffers.cpp - static_streambuf.cpp - static_string.cpp - stream_concepts.cpp - streambuf.cpp - streambuf_readstream.cpp - to_string.cpp version.cpp websocket.cpp - write_streambuf.cpp - detail/base64.cpp - detail/empty_base_optimization.cpp - detail/sha1.cpp ) if (NOT WIN32) diff --git a/test/Jamfile b/test/Jamfile index 02b8e5eb..0c597c81 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -7,33 +7,35 @@ import os ; +compile core.cpp : : ; +compile http.cpp : : ; +compile version.cpp : : ; +compile websocket.cpp : : ; + unit-test core-tests : ../extras/beast/unit_test/main.cpp - async_completion.cpp - basic_streambuf.cpp - bind_handler.cpp - buffer_cat.cpp - buffer_concepts.cpp - buffers_adapter.cpp - consuming_buffers.cpp - error.cpp - handler_alloc.cpp - handler_concepts.cpp - http.cpp - placeholders.cpp - prepare_buffers.cpp - static_streambuf.cpp - static_string.cpp - stream_concepts.cpp - streambuf.cpp - streambuf_readstream.cpp - to_string.cpp - version.cpp - websocket.cpp - write_streambuf.cpp - detail/base64.cpp - detail/empty_base_optimization.cpp - detail/sha1.cpp + core/async_completion.cpp + core/basic_streambuf.cpp + core/bind_handler.cpp + core/buffer_cat.cpp + core/buffer_concepts.cpp + core/buffers_adapter.cpp + core/consuming_buffers.cpp + core/error.cpp + core/handler_alloc.cpp + core/handler_concepts.cpp + core/placeholders.cpp + core/prepare_buffers.cpp + core/static_streambuf.cpp + core/static_string.cpp + core/stream_concepts.cpp + core/streambuf.cpp + core/streambuf_readstream.cpp + core/to_string.cpp + core/write_streambuf.cpp + core/detail/base64.cpp + core/detail/empty_base_optimization.cpp + core/detail/sha1.cpp ; unit-test http-tests : @@ -80,4 +82,3 @@ unit-test websocket-tests : exe websocket-echo : websocket/websocket_echo.cpp ; - diff --git a/test/core.cpp b/test/core.cpp new file mode 100644 index 00000000..d342588e --- /dev/null +++ b/test/core.cpp @@ -0,0 +1,9 @@ +// +// Copyright (c) 2013-2016 Vinnie Falco (vinnie dot falco at gmail dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +// Test that header file is self-contained. +#include diff --git a/test/core/CMakeLists.txt b/test/core/CMakeLists.txt new file mode 100644 index 00000000..d206240e --- /dev/null +++ b/test/core/CMakeLists.txt @@ -0,0 +1,36 @@ +# Part of Beast + +GroupSources(extras/beast beast) +GroupSources(include/beast beast) +GroupSources(test/core "/") + +add_executable (core-tests + ${BEAST_INCLUDES} + ../../extras/beast/unit_test/main.cpp + async_completion.cpp + basic_streambuf.cpp + bind_handler.cpp + buffer_cat.cpp + buffer_concepts.cpp + buffers_adapter.cpp + consuming_buffers.cpp + error.cpp + handler_alloc.cpp + handler_concepts.cpp + placeholders.cpp + prepare_buffers.cpp + static_streambuf.cpp + static_string.cpp + stream_concepts.cpp + streambuf.cpp + streambuf_readstream.cpp + to_string.cpp + write_streambuf.cpp + detail/base64.cpp + detail/empty_base_optimization.cpp + detail/sha1.cpp +) + +if (NOT WIN32) + target_link_libraries(core-tests ${Boost_LIBRARIES}) +endif() diff --git a/test/async_completion.cpp b/test/core/async_completion.cpp similarity index 86% rename from test/async_completion.cpp rename to test/core/async_completion.cpp index 6dd0636f..4b9fbed6 100644 --- a/test/async_completion.cpp +++ b/test/core/async_completion.cpp @@ -6,4 +6,4 @@ // // Test that header file is self-contained. -#include +#include diff --git a/test/basic_streambuf.cpp b/test/core/basic_streambuf.cpp similarity index 98% rename from test/basic_streambuf.cpp rename to test/core/basic_streambuf.cpp index 22a606ef..a24ec6ff 100644 --- a/test/basic_streambuf.cpp +++ b/test/core/basic_streambuf.cpp @@ -6,10 +6,10 @@ // // Test that header file is self-contained. -#include +#include -#include -#include +#include +#include #include #include #include diff --git a/test/bind_handler.cpp b/test/core/bind_handler.cpp similarity index 94% rename from test/bind_handler.cpp rename to test/core/bind_handler.cpp index b89fe47c..84c00973 100644 --- a/test/bind_handler.cpp +++ b/test/core/bind_handler.cpp @@ -6,7 +6,7 @@ // // Test that header file is self-contained. -#include +#include #include #include diff --git a/test/buffer_cat.cpp b/test/core/buffer_cat.cpp similarity index 98% rename from test/buffer_cat.cpp rename to test/core/buffer_cat.cpp index efa8955c..7cb6b54a 100644 --- a/test/buffer_cat.cpp +++ b/test/core/buffer_cat.cpp @@ -6,7 +6,7 @@ // // Test that header file is self-contained. -#include +#include #include #include diff --git a/test/buffer_concepts.cpp b/test/core/buffer_concepts.cpp similarity index 93% rename from test/buffer_concepts.cpp rename to test/core/buffer_concepts.cpp index ac53a476..2a827fa1 100644 --- a/test/buffer_concepts.cpp +++ b/test/core/buffer_concepts.cpp @@ -6,7 +6,7 @@ // // Test that header file is self-contained. -#include +#include namespace beast { diff --git a/test/buffers_adapter.cpp b/test/core/buffers_adapter.cpp similarity index 98% rename from test/buffers_adapter.cpp rename to test/core/buffers_adapter.cpp index a258da58..69f56d9c 100644 --- a/test/buffers_adapter.cpp +++ b/test/core/buffers_adapter.cpp @@ -6,9 +6,9 @@ // // Test that header file is self-contained. -#include +#include -#include +#include #include #include #include diff --git a/test/consuming_buffers.cpp b/test/core/consuming_buffers.cpp similarity index 98% rename from test/consuming_buffers.cpp rename to test/core/consuming_buffers.cpp index 080d2c8d..2b19273a 100644 --- a/test/consuming_buffers.cpp +++ b/test/core/consuming_buffers.cpp @@ -6,7 +6,7 @@ // // Test that header file is self-contained. -#include +#include #include #include diff --git a/test/detail/base64.cpp b/test/core/detail/base64.cpp similarity index 91% rename from test/detail/base64.cpp rename to test/core/detail/base64.cpp index f49d4531..f0445771 100644 --- a/test/detail/base64.cpp +++ b/test/core/detail/base64.cpp @@ -5,7 +5,9 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#include +// Test that header file is self-contained. +#include + #include namespace beast { diff --git a/test/detail/empty_base_optimization.cpp b/test/core/detail/empty_base_optimization.cpp similarity index 94% rename from test/detail/empty_base_optimization.cpp rename to test/core/detail/empty_base_optimization.cpp index 617d65b3..2f9285b3 100644 --- a/test/detail/empty_base_optimization.cpp +++ b/test/core/detail/empty_base_optimization.cpp @@ -5,7 +5,9 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#include +// Test that header file is self-contained. +#include + #include namespace beast { diff --git a/test/detail/sha1.cpp b/test/core/detail/sha1.cpp similarity index 98% rename from test/detail/sha1.cpp rename to test/core/detail/sha1.cpp index aee02c8a..6764a090 100644 --- a/test/detail/sha1.cpp +++ b/test/core/detail/sha1.cpp @@ -5,7 +5,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#include +#include #include #include diff --git a/test/error.cpp b/test/core/error.cpp similarity index 89% rename from test/error.cpp rename to test/core/error.cpp index b89ab190..17afdedc 100644 --- a/test/error.cpp +++ b/test/core/error.cpp @@ -6,4 +6,4 @@ // // Test that header file is self-contained. -#include +#include diff --git a/test/handler_alloc.cpp b/test/core/handler_alloc.cpp similarity index 94% rename from test/handler_alloc.cpp rename to test/core/handler_alloc.cpp index b1034e49..fe890c53 100644 --- a/test/handler_alloc.cpp +++ b/test/core/handler_alloc.cpp @@ -6,7 +6,7 @@ // // Test that header file is self-contained. -#include +#include #include #include diff --git a/test/handler_concepts.cpp b/test/core/handler_concepts.cpp similarity index 92% rename from test/handler_concepts.cpp rename to test/core/handler_concepts.cpp index c75c7381..1e44de48 100644 --- a/test/handler_concepts.cpp +++ b/test/core/handler_concepts.cpp @@ -6,7 +6,7 @@ // // Test that header file is self-contained. -#include +#include namespace beast { diff --git a/test/placeholders.cpp b/test/core/placeholders.cpp similarity index 87% rename from test/placeholders.cpp rename to test/core/placeholders.cpp index d16718b8..6fa36564 100644 --- a/test/placeholders.cpp +++ b/test/core/placeholders.cpp @@ -6,4 +6,4 @@ // // Test that header file is self-contained. -#include +#include diff --git a/test/prepare_buffers.cpp b/test/core/prepare_buffers.cpp similarity index 97% rename from test/prepare_buffers.cpp rename to test/core/prepare_buffers.cpp index 13897b4a..17ecbffd 100644 --- a/test/prepare_buffers.cpp +++ b/test/core/prepare_buffers.cpp @@ -6,9 +6,9 @@ // // Test that header file is self-contained. -#include +#include -#include +#include #include #include #include diff --git a/test/static_streambuf.cpp b/test/core/static_streambuf.cpp similarity index 99% rename from test/static_streambuf.cpp rename to test/core/static_streambuf.cpp index 5d60d84c..bfcf4a6a 100644 --- a/test/static_streambuf.cpp +++ b/test/core/static_streambuf.cpp @@ -6,7 +6,7 @@ // // Test that header file is self-contained. -#include +#include #include #include diff --git a/test/static_string.cpp b/test/core/static_string.cpp similarity index 99% rename from test/static_string.cpp rename to test/core/static_string.cpp index 1b73c250..1fe084e7 100644 --- a/test/static_string.cpp +++ b/test/core/static_string.cpp @@ -6,7 +6,7 @@ // // Test that header file is self-contained. -#include +#include #include diff --git a/test/stream_concepts.cpp b/test/core/stream_concepts.cpp similarity index 96% rename from test/stream_concepts.cpp rename to test/core/stream_concepts.cpp index 3c1fdac3..afc91ed0 100644 --- a/test/stream_concepts.cpp +++ b/test/core/stream_concepts.cpp @@ -6,7 +6,7 @@ // // Test that header file is self-contained. -#include +#include #include namespace beast { diff --git a/test/streambuf.cpp b/test/core/streambuf.cpp similarity index 88% rename from test/streambuf.cpp rename to test/core/streambuf.cpp index 608d5427..08823eb7 100644 --- a/test/streambuf.cpp +++ b/test/core/streambuf.cpp @@ -6,4 +6,4 @@ // // Test that header file is self-contained. -#include +#include diff --git a/test/streambuf_readstream.cpp b/test/core/streambuf_readstream.cpp similarity index 93% rename from test/streambuf_readstream.cpp rename to test/core/streambuf_readstream.cpp index 22a0d2fb..b7d17fab 100644 --- a/test/streambuf_readstream.cpp +++ b/test/core/streambuf_readstream.cpp @@ -6,9 +6,9 @@ // // Test that header file is self-contained. -#include +#include -#include +#include #include #include diff --git a/test/to_string.cpp b/test/core/to_string.cpp similarity index 88% rename from test/to_string.cpp rename to test/core/to_string.cpp index 610a5adb..660e643f 100644 --- a/test/to_string.cpp +++ b/test/core/to_string.cpp @@ -6,5 +6,5 @@ // // Test that header file is self-contained. -#include +#include diff --git a/test/write_streambuf.cpp b/test/core/write_streambuf.cpp similarity index 91% rename from test/write_streambuf.cpp rename to test/core/write_streambuf.cpp index 79fc8833..15417e31 100644 --- a/test/write_streambuf.cpp +++ b/test/core/write_streambuf.cpp @@ -6,8 +6,9 @@ // // Test that header file is self-contained. -#include -#include +#include + +#include #include namespace beast { diff --git a/test/http/CMakeLists.txt b/test/http/CMakeLists.txt index 8c4749b0..ccbacbbe 100644 --- a/test/http/CMakeLists.txt +++ b/test/http/CMakeLists.txt @@ -38,7 +38,3 @@ add_executable (bench-tests nodejs_parser.cpp parser_bench.cpp ) - -if (NOT WIN32) - target_link_libraries(parser-bench ${Boost_LIBRARIES}) -endif() diff --git a/test/http/basic_parser_v1.cpp b/test/http/basic_parser_v1.cpp index cbf7194e..29cf7173 100644 --- a/test/http/basic_parser_v1.cpp +++ b/test/http/basic_parser_v1.cpp @@ -10,10 +10,10 @@ #include "message_fuzz.hpp" -#include -#include +#include +#include +#include #include -#include #include #include #include diff --git a/test/http/message_fuzz.hpp b/test/http/message_fuzz.hpp index bf5f3296..ef130187 100644 --- a/test/http/message_fuzz.hpp +++ b/test/http/message_fuzz.hpp @@ -8,8 +8,8 @@ #ifndef BEAST_HTTP_TEST_MESSAGE_FUZZ_HPP #define BEAST_HTTP_TEST_MESSAGE_FUZZ_HPP +#include #include -#include #include #include #include diff --git a/test/http/message_v1.cpp b/test/http/message_v1.cpp index 2ed945b2..a1aa6659 100644 --- a/test/http/message_v1.cpp +++ b/test/http/message_v1.cpp @@ -22,8 +22,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/test/http/nodejs_parser.hpp b/test/http/nodejs_parser.hpp index 7e7291b6..d197958f 100644 --- a/test/http/nodejs_parser.hpp +++ b/test/http/nodejs_parser.hpp @@ -10,10 +10,10 @@ #include "nodejs-parser/http_parser.h" -#include #include #include -#include +#include +#include #include #include #include diff --git a/test/http/parser_bench.cpp b/test/http/parser_bench.cpp index 8c040556..086d96ed 100644 --- a/test/http/parser_bench.cpp +++ b/test/http/parser_bench.cpp @@ -7,9 +7,10 @@ #include "nodejs_parser.hpp" #include "message_fuzz.hpp" + #include -#include -#include +#include +#include #include #include #include diff --git a/test/http/write.cpp b/test/http/write.cpp index 053a74f7..3ad8a597 100644 --- a/test/http/write.cpp +++ b/test/http/write.cpp @@ -8,14 +8,14 @@ // Test that header file is self-contained. #include -#include #include #include #include #include #include -#include -#include +#include +#include +#include #include #include #include @@ -37,7 +37,7 @@ public: error_code ec; auto const n = write_some(buffers, ec); if(ec) - throw boost::system::system_error{ec}; + throw system_error{ec}; return n; } diff --git a/test/websocket/stream.cpp b/test/websocket/stream.cpp index 14dae27a..7a1c45e0 100644 --- a/test/websocket/stream.cpp +++ b/test/websocket/stream.cpp @@ -11,8 +11,8 @@ #include "websocket_async_echo_peer.hpp" #include "websocket_sync_echo_peer.hpp" -#include -#include +#include +#include #include #include #include diff --git a/test/websocket/utf8_checker.cpp b/test/websocket/utf8_checker.cpp index 62a9d711..2399c7c9 100644 --- a/test/websocket/utf8_checker.cpp +++ b/test/websocket/utf8_checker.cpp @@ -8,7 +8,7 @@ // Test that header file is self-contained. #include -#include +#include #include #include diff --git a/test/websocket/websocket_async_echo_peer.hpp b/test/websocket/websocket_async_echo_peer.hpp index 33bdbdd6..90ff8697 100644 --- a/test/websocket/websocket_async_echo_peer.hpp +++ b/test/websocket/websocket_async_echo_peer.hpp @@ -20,8 +20,8 @@ #ifndef BEAST_WEBSOCKET_ASYNC_ECHO_PEER_H_INCLUDED #define BEAST_WEBSOCKET_ASYNC_ECHO_PEER_H_INCLUDED -#include -#include +#include +#include #include #include #include diff --git a/test/websocket/websocket_sync_echo_peer.hpp b/test/websocket/websocket_sync_echo_peer.hpp index 6edb1a5f..14e9c6c9 100644 --- a/test/websocket/websocket_sync_echo_peer.hpp +++ b/test/websocket/websocket_sync_echo_peer.hpp @@ -20,7 +20,7 @@ #ifndef BEAST_WEBSOCKET_SYNC_ECHO_PEER_H_INCLUDED #define BEAST_WEBSOCKET_SYNC_ECHO_PEER_H_INCLUDED -#include +#include #include #include #include