From 827ecf5e93d0abfc42da0e2800bcd36f8ebe46b2 Mon Sep 17 00:00:00 2001 From: Mohammad Nejati Date: Sat, 23 Nov 2024 06:20:00 +0000 Subject: [PATCH] Organize source files in CMakeLists with source_group --- .../server-flex-awaitable/CMakeLists.txt | 4 + example/advanced/server-flex/CMakeLists.txt | 4 + example/advanced/server/CMakeLists.txt | 4 + example/echo-op/CMakeLists.txt | 4 + .../async-ssl-system-executor/CMakeLists.txt | 4 + example/http/client/async-ssl/CMakeLists.txt | 4 + example/http/client/async/CMakeLists.txt | 4 + .../http/client/awaitable-ssl/CMakeLists.txt | 4 + example/http/client/awaitable/CMakeLists.txt | 4 + example/http/client/body/CMakeLists.txt | 4 + example/http/client/coro-ssl/CMakeLists.txt | 4 + example/http/client/coro/CMakeLists.txt | 4 + example/http/client/crawl/CMakeLists.txt | 5 + example/http/client/methods/CMakeLists.txt | 4 + example/http/client/sync-ssl/CMakeLists.txt | 4 + example/http/client/sync/CMakeLists.txt | 4 + example/http/server/async-ssl/CMakeLists.txt | 4 + example/http/server/async/CMakeLists.txt | 4 + example/http/server/awaitable/CMakeLists.txt | 4 + example/http/server/coro-ssl/CMakeLists.txt | 4 + example/http/server/coro/CMakeLists.txt | 4 + example/http/server/fast/CMakeLists.txt | 4 + example/http/server/flex/CMakeLists.txt | 4 + example/http/server/small/CMakeLists.txt | 4 + .../http/server/stackless-ssl/CMakeLists.txt | 4 + example/http/server/stackless/CMakeLists.txt | 4 + example/http/server/sync-ssl/CMakeLists.txt | 4 + example/http/server/sync/CMakeLists.txt | 4 + .../async-ssl-system-executor/CMakeLists.txt | 4 + .../websocket/client/async-ssl/CMakeLists.txt | 4 + example/websocket/client/async/CMakeLists.txt | 4 + .../websocket/client/awaitable/CMakeLists.txt | 4 + .../websocket/client/coro-ssl/CMakeLists.txt | 4 + example/websocket/client/coro/CMakeLists.txt | 4 + .../websocket/client/sync-ssl/CMakeLists.txt | 4 + example/websocket/client/sync/CMakeLists.txt | 4 + .../websocket/server/async-ssl/CMakeLists.txt | 4 + example/websocket/server/async/CMakeLists.txt | 4 + .../websocket/server/awaitable/CMakeLists.txt | 4 + .../server/chat-multi/CMakeLists.txt | 15 + .../websocket/server/coro-ssl/CMakeLists.txt | 4 + example/websocket/server/coro/CMakeLists.txt | 4 + example/websocket/server/fast/CMakeLists.txt | 4 + .../server/stackless-ssl/CMakeLists.txt | 4 + .../websocket/server/stackless/CMakeLists.txt | 4 + .../websocket/server/sync-ssl/CMakeLists.txt | 4 + example/websocket/server/sync/CMakeLists.txt | 4 + test/CMakeLists.txt | 4 + test/beast/CMakeLists.txt | 9 + test/beast/_experimental/CMakeLists.txt | 8 + test/beast/core/CMakeLists.txt | 59 +--- test/beast/core/_detail_static_const.cpp | 44 --- test/beast/core/close_socket.cpp | 39 --- test/beast/core/make_strand.cpp | 49 --- test/beast/core/prepare_buffers.cpp | 12 - test/beast/core/zlib.cpp | 235 --------------- test/beast/http/CMakeLists.txt | 48 +-- test/beast/ssl/CMakeLists.txt | 4 + test/beast/websocket/CMakeLists.txt | 35 +-- test/beast/websocket/doc_snippets.cpp | 285 ------------------ test/beast/zlib/CMakeLists.txt | 9 +- test/bench/buffers/CMakeLists.txt | 4 + test/bench/parser/CMakeLists.txt | 6 + test/bench/utf8_checker/CMakeLists.txt | 4 + test/bench/wsload/CMakeLists.txt | 4 + test/bench/zlib/CMakeLists.txt | 7 +- test/cmake_test/CMakeLists.txt | 1 + test/doc/CMakeLists.txt | 27 +- test/example/common/CMakeLists.txt | 7 +- test/fuzz/CMakeLists.txt | 1 + 70 files changed, 285 insertions(+), 816 deletions(-) delete mode 100644 test/beast/core/_detail_static_const.cpp delete mode 100644 test/beast/core/close_socket.cpp delete mode 100644 test/beast/core/make_strand.cpp delete mode 100644 test/beast/core/prepare_buffers.cpp delete mode 100644 test/beast/core/zlib.cpp delete mode 100644 test/beast/websocket/doc_snippets.cpp diff --git a/example/advanced/server-flex-awaitable/CMakeLists.txt b/example/advanced/server-flex-awaitable/CMakeLists.txt index afeaa40e..0090f601 100644 --- a/example/advanced/server-flex-awaitable/CMakeLists.txt +++ b/example/advanced/server-flex-awaitable/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(advanced-server-flex-awaitable Jamfile advanced_server_flex_awaitable.cpp) +source_group("" FILES + Jamfile + advanced_server_flex_awaitable.cpp) + target_include_directories(advanced-server-flex-awaitable PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/advanced/server-flex/CMakeLists.txt b/example/advanced/server-flex/CMakeLists.txt index 299554ae..9bd2363f 100644 --- a/example/advanced/server-flex/CMakeLists.txt +++ b/example/advanced/server-flex/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(advanced-server-flex Jamfile advanced_server_flex.cpp) +source_group("" FILES + Jamfile + advanced_server_flex.cpp) + target_include_directories(advanced-server-flex PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/advanced/server/CMakeLists.txt b/example/advanced/server/CMakeLists.txt index b04a50a1..715b4831 100644 --- a/example/advanced/server/CMakeLists.txt +++ b/example/advanced/server/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(advanced-server Jamfile advanced_server.cpp) +source_group("" FILES + Jamfile + advanced_server.cpp) + target_link_libraries(advanced-server PRIVATE Boost::beast) set_target_properties(advanced-server PROPERTIES FOLDER "example-advanced-server") diff --git a/example/echo-op/CMakeLists.txt b/example/echo-op/CMakeLists.txt index 4f224ad8..7bece942 100644 --- a/example/echo-op/CMakeLists.txt +++ b/example/echo-op/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(echo-op Jamfile echo_op.cpp) +source_group("" FILES + Jamfile + echo_op.cpp) + target_link_libraries(echo-op PRIVATE Boost::beast) set_target_properties(echo-op diff --git a/example/http/client/async-ssl-system-executor/CMakeLists.txt b/example/http/client/async-ssl-system-executor/CMakeLists.txt index 1f2f1b23..ef193a77 100644 --- a/example/http/client/async-ssl-system-executor/CMakeLists.txt +++ b/example/http/client/async-ssl-system-executor/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-client-async-ssl-system-executor Jamfile http_client_async_ssl_system_executor.cpp) +source_group("" FILES + Jamfile + http_client_async_ssl_system_executor.cpp) + target_include_directories(http-client-async-ssl-system-executor PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/http/client/async-ssl/CMakeLists.txt b/example/http/client/async-ssl/CMakeLists.txt index 23ecde2a..0f5cc2b1 100644 --- a/example/http/client/async-ssl/CMakeLists.txt +++ b/example/http/client/async-ssl/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-client-async-ssl Jamfile http_client_async_ssl.cpp) +source_group("" FILES + Jamfile + http_client_async_ssl.cpp) + target_include_directories(http-client-async-ssl PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/http/client/async/CMakeLists.txt b/example/http/client/async/CMakeLists.txt index ad88934f..96b9d3fe 100644 --- a/example/http/client/async/CMakeLists.txt +++ b/example/http/client/async/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-client-async Jamfile http_client_async.cpp) +source_group("" FILES + Jamfile + http_client_async.cpp) + target_link_libraries(http-client-async PRIVATE Boost::beast) set_target_properties(http-client-async diff --git a/example/http/client/awaitable-ssl/CMakeLists.txt b/example/http/client/awaitable-ssl/CMakeLists.txt index 0669b7de..066cdf5c 100644 --- a/example/http/client/awaitable-ssl/CMakeLists.txt +++ b/example/http/client/awaitable-ssl/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-client-awaitable-ssl Jamfile http_client_awaitable_ssl.cpp) +source_group("" FILES + Jamfile + http_client_awaitable_ssl.cpp) + target_include_directories(http-client-awaitable-ssl PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/http/client/awaitable/CMakeLists.txt b/example/http/client/awaitable/CMakeLists.txt index 8f042762..a5a5a9a4 100644 --- a/example/http/client/awaitable/CMakeLists.txt +++ b/example/http/client/awaitable/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-client-awaitable Jamfile http_client_awaitable.cpp) +source_group("" FILES + Jamfile + http_client_awaitable.cpp) + target_link_libraries(http-client-awaitable PRIVATE Boost::beast) set_target_properties(http-client-awaitable diff --git a/example/http/client/body/CMakeLists.txt b/example/http/client/body/CMakeLists.txt index d57d12ee..8481846f 100644 --- a/example/http/client/body/CMakeLists.txt +++ b/example/http/client/body/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-client-json Jamfile json_client.cpp) +source_group("" FILES + Jamfile + json_client.cpp) + target_link_libraries(http-client-json PRIVATE Boost::beast Boost::json) set_target_properties(http-client-json diff --git a/example/http/client/coro-ssl/CMakeLists.txt b/example/http/client/coro-ssl/CMakeLists.txt index 2bcdff42..5ccc4f73 100644 --- a/example/http/client/coro-ssl/CMakeLists.txt +++ b/example/http/client/coro-ssl/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-client-coro-ssl Jamfile http_client_coro_ssl.cpp) +source_group("" FILES + Jamfile + http_client_coro_ssl.cpp) + target_include_directories(http-client-coro-ssl PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/http/client/coro/CMakeLists.txt b/example/http/client/coro/CMakeLists.txt index a6236519..05e30c3f 100644 --- a/example/http/client/coro/CMakeLists.txt +++ b/example/http/client/coro/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-client-coro Jamfile http_client_coro.cpp) +source_group("" FILES + Jamfile + http_client_coro.cpp) + target_link_libraries(http-client-coro PRIVATE Boost::beast) set_target_properties(http-client-coro diff --git a/example/http/client/crawl/CMakeLists.txt b/example/http/client/crawl/CMakeLists.txt index 788bd44f..ba342a1b 100644 --- a/example/http/client/crawl/CMakeLists.txt +++ b/example/http/client/crawl/CMakeLists.txt @@ -13,6 +13,11 @@ add_executable(http-crawl http_crawl.cpp urls_large_data.cpp) +source_group("" FILES + Jamfile + http_crawl.cpp + urls_large_data.cpp) + target_link_libraries(http-crawl PRIVATE Boost::beast) set_target_properties(http-crawl diff --git a/example/http/client/methods/CMakeLists.txt b/example/http/client/methods/CMakeLists.txt index 9345b20f..2e9fcdcb 100644 --- a/example/http/client/methods/CMakeLists.txt +++ b/example/http/client/methods/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-client-methods Jamfile http_client_methods.cpp) +source_group("" FILES + Jamfile + http_client_methods.cpp) + target_link_libraries(http-client-methods PRIVATE Boost::beast) set_target_properties(http-client-methods diff --git a/example/http/client/sync-ssl/CMakeLists.txt b/example/http/client/sync-ssl/CMakeLists.txt index a91a4a3d..42e4d75f 100644 --- a/example/http/client/sync-ssl/CMakeLists.txt +++ b/example/http/client/sync-ssl/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-client-sync-ssl Jamfile http_client_sync_ssl.cpp) +source_group("" FILES + Jamfile + http_client_sync_ssl.cpp) + target_include_directories(http-client-sync-ssl PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/http/client/sync/CMakeLists.txt b/example/http/client/sync/CMakeLists.txt index 195969c7..f1765ef8 100644 --- a/example/http/client/sync/CMakeLists.txt +++ b/example/http/client/sync/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-client-sync Jamfile http_client_sync.cpp) +source_group("" FILES + Jamfile + http_client_sync.cpp) + target_link_libraries(http-client-sync PRIVATE Boost::beast) set_target_properties(http-client-sync diff --git a/example/http/server/async-ssl/CMakeLists.txt b/example/http/server/async-ssl/CMakeLists.txt index 029d6eea..a225deb7 100644 --- a/example/http/server/async-ssl/CMakeLists.txt +++ b/example/http/server/async-ssl/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-server-async-ssl Jamfile http_server_async_ssl.cpp) +source_group("" FILES + Jamfile + http_server_async_ssl.cpp) + target_include_directories(http-server-async-ssl PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/http/server/async/CMakeLists.txt b/example/http/server/async/CMakeLists.txt index 05d04374..c3a13b1c 100644 --- a/example/http/server/async/CMakeLists.txt +++ b/example/http/server/async/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-server-async Jamfile http_server_async.cpp) +source_group("" FILES + Jamfile + http_server_async.cpp) + target_link_libraries(http-server-async PRIVATE Boost::beast) set_target_properties(http-server-async diff --git a/example/http/server/awaitable/CMakeLists.txt b/example/http/server/awaitable/CMakeLists.txt index f9124d11..ed0aaa79 100644 --- a/example/http/server/awaitable/CMakeLists.txt +++ b/example/http/server/awaitable/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-server-awaitable Jamfile http_server_awaitable.cpp) +source_group("" FILES + Jamfile + http_server_awaitable.cpp) + target_link_libraries(http-server-awaitable PRIVATE Boost::beast) set_target_properties(http-server-awaitable diff --git a/example/http/server/coro-ssl/CMakeLists.txt b/example/http/server/coro-ssl/CMakeLists.txt index 8b816d1f..19846a81 100644 --- a/example/http/server/coro-ssl/CMakeLists.txt +++ b/example/http/server/coro-ssl/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-server-coro-ssl Jamfile http_server_coro_ssl.cpp) +source_group("" FILES + Jamfile + http_server_coro_ssl.cpp) + target_include_directories(http-server-coro-ssl PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/http/server/coro/CMakeLists.txt b/example/http/server/coro/CMakeLists.txt index eaab2148..c7b24be6 100644 --- a/example/http/server/coro/CMakeLists.txt +++ b/example/http/server/coro/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-server-coro Jamfile http_server_coro.cpp) +source_group("" FILES + Jamfile + http_server_coro.cpp) + target_link_libraries(http-server-coro PRIVATE Boost::beast) set_target_properties(http-server-coro diff --git a/example/http/server/fast/CMakeLists.txt b/example/http/server/fast/CMakeLists.txt index 06c3cd20..6c907ae1 100644 --- a/example/http/server/fast/CMakeLists.txt +++ b/example/http/server/fast/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-server-fast Jamfile http_server_fast.cpp) +source_group("" FILES + Jamfile + http_server_fast.cpp) + target_link_libraries(http-server-fast PRIVATE Boost::beast) set_target_properties(http-server-fast diff --git a/example/http/server/flex/CMakeLists.txt b/example/http/server/flex/CMakeLists.txt index c490265d..1cc4b489 100644 --- a/example/http/server/flex/CMakeLists.txt +++ b/example/http/server/flex/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-server-flex Jamfile http_server_flex.cpp) +source_group("" FILES + Jamfile + http_server_flex.cpp) + target_include_directories(http-server-flex PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/http/server/small/CMakeLists.txt b/example/http/server/small/CMakeLists.txt index 9d08821b..f2dc8944 100644 --- a/example/http/server/small/CMakeLists.txt +++ b/example/http/server/small/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-server-small Jamfile http_server_small.cpp) +source_group("" FILES + Jamfile + http_server_small.cpp) + target_link_libraries(http-server-small PRIVATE Boost::beast) set_target_properties(http-server-small diff --git a/example/http/server/stackless-ssl/CMakeLists.txt b/example/http/server/stackless-ssl/CMakeLists.txt index 7a436d28..2c4aa2cb 100644 --- a/example/http/server/stackless-ssl/CMakeLists.txt +++ b/example/http/server/stackless-ssl/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-server-stackless-ssl Jamfile http_server_stackless_ssl.cpp) +source_group("" FILES + Jamfile + http_server_stackless_ssl.cpp) + target_include_directories(http-server-stackless-ssl PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/http/server/stackless/CMakeLists.txt b/example/http/server/stackless/CMakeLists.txt index e9cb37ed..77d7123b 100644 --- a/example/http/server/stackless/CMakeLists.txt +++ b/example/http/server/stackless/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-server-stackless Jamfile http_server_stackless.cpp) +source_group("" FILES + Jamfile + http_server_stackless.cpp) + target_link_libraries(http-server-stackless PRIVATE Boost::beast) set_target_properties(http-server-stackless diff --git a/example/http/server/sync-ssl/CMakeLists.txt b/example/http/server/sync-ssl/CMakeLists.txt index 92895cda..7d2b2e85 100644 --- a/example/http/server/sync-ssl/CMakeLists.txt +++ b/example/http/server/sync-ssl/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-server-sync-ssl Jamfile http_server_sync_ssl.cpp) +source_group("" FILES + Jamfile + http_server_sync_ssl.cpp) + target_include_directories(http-server-sync-ssl PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/http/server/sync/CMakeLists.txt b/example/http/server/sync/CMakeLists.txt index e0861d1e..7ba1f08c 100644 --- a/example/http/server/sync/CMakeLists.txt +++ b/example/http/server/sync/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(http-server-sync Jamfile http_server_sync.cpp) +source_group("" FILES + Jamfile + http_server_sync.cpp) + target_link_libraries(http-server-sync PRIVATE Boost::beast) set_target_properties(http-server-sync diff --git a/example/websocket/client/async-ssl-system-executor/CMakeLists.txt b/example/websocket/client/async-ssl-system-executor/CMakeLists.txt index 589179f8..4f8c9c8f 100644 --- a/example/websocket/client/async-ssl-system-executor/CMakeLists.txt +++ b/example/websocket/client/async-ssl-system-executor/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-client-async-ssl-system-executor Jamfile websocket_client_async_ssl_system_executor.cpp) +source_group("" FILES + Jamfile + websocket_client_async_ssl_system_executor.cpp) + target_include_directories(websocket-client-async-ssl-system-executor PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/websocket/client/async-ssl/CMakeLists.txt b/example/websocket/client/async-ssl/CMakeLists.txt index 85286de8..49f5aad9 100644 --- a/example/websocket/client/async-ssl/CMakeLists.txt +++ b/example/websocket/client/async-ssl/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-client-async-ssl Jamfile websocket_client_async_ssl.cpp) +source_group("" FILES + Jamfile + websocket_client_async_ssl.cpp) + target_include_directories(websocket-client-async-ssl PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/websocket/client/async/CMakeLists.txt b/example/websocket/client/async/CMakeLists.txt index 0d84d50e..2fd98e7e 100644 --- a/example/websocket/client/async/CMakeLists.txt +++ b/example/websocket/client/async/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-client-async Jamfile websocket_client_async.cpp) +source_group("" FILES + Jamfile + websocket_client_async.cpp) + target_link_libraries(websocket-client-async PRIVATE Boost::beast) set_target_properties(websocket-client-async diff --git a/example/websocket/client/awaitable/CMakeLists.txt b/example/websocket/client/awaitable/CMakeLists.txt index fbafe01e..eeb29711 100644 --- a/example/websocket/client/awaitable/CMakeLists.txt +++ b/example/websocket/client/awaitable/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-client-awaitable Jamfile websocket_client_awaitable.cpp) +source_group("" FILES + Jamfile + websocket_client_awaitable.cpp) + target_link_libraries(websocket-client-awaitable PRIVATE Boost::beast) set_target_properties(websocket-client-awaitable diff --git a/example/websocket/client/coro-ssl/CMakeLists.txt b/example/websocket/client/coro-ssl/CMakeLists.txt index 6a7def74..a6673ebc 100644 --- a/example/websocket/client/coro-ssl/CMakeLists.txt +++ b/example/websocket/client/coro-ssl/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-client-coro-ssl Jamfile websocket_client_coro_ssl.cpp) +source_group("" FILES + Jamfile + websocket_client_coro_ssl.cpp) + target_include_directories(websocket-client-coro-ssl PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/websocket/client/coro/CMakeLists.txt b/example/websocket/client/coro/CMakeLists.txt index 62678d37..0d7c78fd 100644 --- a/example/websocket/client/coro/CMakeLists.txt +++ b/example/websocket/client/coro/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-client-coro Jamfile websocket_client_coro.cpp) +source_group("" FILES + Jamfile + websocket_client_coro.cpp) + target_link_libraries(websocket-client-coro PRIVATE Boost::beast) set_target_properties(websocket-client-coro diff --git a/example/websocket/client/sync-ssl/CMakeLists.txt b/example/websocket/client/sync-ssl/CMakeLists.txt index a59c2320..8edc3e9a 100644 --- a/example/websocket/client/sync-ssl/CMakeLists.txt +++ b/example/websocket/client/sync-ssl/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-client-sync-ssl Jamfile websocket_client_sync_ssl.cpp) +source_group("" FILES + Jamfile + websocket_client_sync_ssl.cpp) + target_include_directories(websocket-client-sync-ssl PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/websocket/client/sync/CMakeLists.txt b/example/websocket/client/sync/CMakeLists.txt index 473832bb..859617d7 100644 --- a/example/websocket/client/sync/CMakeLists.txt +++ b/example/websocket/client/sync/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-client-sync Jamfile websocket_client_sync.cpp) +source_group("" FILES + Jamfile + websocket_client_sync.cpp) + target_link_libraries(websocket-client-sync PRIVATE Boost::beast) set_target_properties(websocket-client-sync diff --git a/example/websocket/server/async-ssl/CMakeLists.txt b/example/websocket/server/async-ssl/CMakeLists.txt index 70e28478..6ff3c8bf 100644 --- a/example/websocket/server/async-ssl/CMakeLists.txt +++ b/example/websocket/server/async-ssl/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-server-async-ssl Jamfile websocket_server_async_ssl.cpp) +source_group("" FILES + Jamfile + websocket_server_async_ssl.cpp) + target_include_directories(websocket-server-async-ssl PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/websocket/server/async/CMakeLists.txt b/example/websocket/server/async/CMakeLists.txt index 0632e469..854ed96c 100644 --- a/example/websocket/server/async/CMakeLists.txt +++ b/example/websocket/server/async/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-server-async Jamfile websocket_server_async.cpp) +source_group("" FILES + Jamfile + websocket_server_async.cpp) + target_link_libraries(websocket-server-async PRIVATE Boost::beast) set_target_properties(websocket-server-async diff --git a/example/websocket/server/awaitable/CMakeLists.txt b/example/websocket/server/awaitable/CMakeLists.txt index ecf1d5f2..0c20d00b 100644 --- a/example/websocket/server/awaitable/CMakeLists.txt +++ b/example/websocket/server/awaitable/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-server-awaitable Jamfile websocket_server_awaitable.cpp) +source_group("" FILES + Jamfile + websocket_server_awaitable.cpp) + target_link_libraries(websocket-server-awaitable PRIVATE Boost::beast) set_target_properties(websocket-server-awaitable diff --git a/example/websocket/server/chat-multi/CMakeLists.txt b/example/websocket/server/chat-multi/CMakeLists.txt index 12ce0a7d..355004df 100644 --- a/example/websocket/server/chat-multi/CMakeLists.txt +++ b/example/websocket/server/chat-multi/CMakeLists.txt @@ -23,6 +23,21 @@ add_executable(websocket-chat-multi websocket_session.cpp websocket_session.hpp) +source_group("" FILES + beast.hpp + chat_client.html + http_session.cpp + http_session.hpp + Jamfile + listener.cpp + listener.hpp + main.cpp + net.hpp + shared_state.cpp + shared_state.hpp + websocket_session.cpp + websocket_session.hpp) + target_link_libraries(websocket-chat-multi PRIVATE Boost::beast) set_target_properties(websocket-chat-multi diff --git a/example/websocket/server/coro-ssl/CMakeLists.txt b/example/websocket/server/coro-ssl/CMakeLists.txt index 26b283cf..ff76ffe2 100644 --- a/example/websocket/server/coro-ssl/CMakeLists.txt +++ b/example/websocket/server/coro-ssl/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-server-coro-ssl Jamfile websocket_server_coro_ssl.cpp) +source_group("" FILES + Jamfile + websocket_server_coro_ssl.cpp) + target_include_directories(websocket-server-coro-ssl PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/websocket/server/coro/CMakeLists.txt b/example/websocket/server/coro/CMakeLists.txt index 7e12398b..87eb5cb3 100644 --- a/example/websocket/server/coro/CMakeLists.txt +++ b/example/websocket/server/coro/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-server-coro Jamfile websocket_server_coro.cpp) +source_group("" FILES + Jamfile + websocket_server_coro.cpp) + target_link_libraries(websocket-server-coro PRIVATE Boost::beast) set_target_properties(websocket-server-coro diff --git a/example/websocket/server/fast/CMakeLists.txt b/example/websocket/server/fast/CMakeLists.txt index 34e663c5..562407f7 100644 --- a/example/websocket/server/fast/CMakeLists.txt +++ b/example/websocket/server/fast/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-server-fast Jamfile websocket_server_fast.cpp) +source_group("" FILES + Jamfile + websocket_server_fast.cpp) + target_link_libraries(websocket-server-fast PRIVATE Boost::beast) set_target_properties(websocket-server-fast diff --git a/example/websocket/server/stackless-ssl/CMakeLists.txt b/example/websocket/server/stackless-ssl/CMakeLists.txt index 225f592c..148b1018 100644 --- a/example/websocket/server/stackless-ssl/CMakeLists.txt +++ b/example/websocket/server/stackless-ssl/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-server-stackless-ssl Jamfile websocket_server_stackless_ssl.cpp) +source_group("" FILES + Jamfile + websocket_server_stackless_ssl.cpp) + target_include_directories(websocket-server-stackless-ssl PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/websocket/server/stackless/CMakeLists.txt b/example/websocket/server/stackless/CMakeLists.txt index 4ba04748..9afa7529 100644 --- a/example/websocket/server/stackless/CMakeLists.txt +++ b/example/websocket/server/stackless/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-server-stackless Jamfile websocket_server_stackless.cpp) +source_group("" FILES + Jamfile + websocket_server_stackless.cpp) + target_link_libraries(websocket-server-stackless PRIVATE Boost::beast) set_target_properties(websocket-server-stackless diff --git a/example/websocket/server/sync-ssl/CMakeLists.txt b/example/websocket/server/sync-ssl/CMakeLists.txt index 780abcfc..4b32c898 100644 --- a/example/websocket/server/sync-ssl/CMakeLists.txt +++ b/example/websocket/server/sync-ssl/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-server-sync-ssl Jamfile websocket_server_sync_ssl.cpp) +source_group("" FILES + Jamfile + websocket_server_sync_ssl.cpp) + target_include_directories(websocket-server-sync-ssl PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/example/websocket/server/sync/CMakeLists.txt b/example/websocket/server/sync/CMakeLists.txt index ba5fd5dc..7e203055 100644 --- a/example/websocket/server/sync/CMakeLists.txt +++ b/example/websocket/server/sync/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(websocket-server-sync Jamfile websocket_server_sync.cpp) +source_group("" FILES + Jamfile + websocket_server_sync.cpp) + target_link_libraries(websocket-server-sync PRIVATE Boost::beast) set_target_properties(websocket-server-sync diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4ef1e9f0..a956d5ff 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -12,6 +12,7 @@ find_package(OpenSSL) # lib-asio add_library(lib-asio STATIC lib_asio.cpp) +source_group("" FILES lib_asio.cpp) target_compile_definitions(lib-asio PUBLIC BOOST_ASIO_SEPARATE_COMPILATION BOOST_ASIO_NO_DEPRECATED @@ -24,12 +25,14 @@ set_target_properties(lib-asio PROPERTIES FOLDER "static-libs") # lib-asio-ssl add_library(lib-asio-ssl STATIC lib_asio_ssl.cpp) +source_group("" FILES lib_asio_ssl.cpp) target_link_libraries(lib-asio-ssl PUBLIC lib-asio) target_link_libraries(lib-asio-ssl PUBLIC OpenSSL::SSL OpenSSL::Crypto) set_target_properties(lib-asio-ssl PROPERTIES FOLDER "static-libs") # lib-beast add_library(lib-beast STATIC lib_beast.cpp) +source_group("" FILES lib_beast.cpp) target_compile_definitions(lib-beast PUBLIC BOOST_BEAST_SEPARATE_COMPILATION) target_link_libraries(lib-beast PUBLIC Boost::beast lib-asio) set_target_properties(lib-beast PROPERTIES FOLDER "static-libs") @@ -58,6 +61,7 @@ set_target_properties(lib-zlib PROPERTIES FOLDER "static-libs") # lib-test add_library(lib-test STATIC lib_test.cpp) +source_group("" FILES lib_test.cpp) target_include_directories(lib-test PUBLIC extras/include) target_link_libraries(lib-test PUBLIC lib-beast) set_target_properties(lib-test PROPERTIES FOLDER "static-libs") diff --git a/test/beast/CMakeLists.txt b/test/beast/CMakeLists.txt index a2966d85..78ce0952 100644 --- a/test/beast/CMakeLists.txt +++ b/test/beast/CMakeLists.txt @@ -27,6 +27,15 @@ add_executable(tests-beast websocket.cpp zlib.cpp) +source_group("" FILES + Jamfile + core.cpp + http.cpp + ssl.cpp + version.cpp + websocket.cpp + zlib.cpp) + target_link_libraries(tests-beast lib-asio-ssl lib-test) diff --git a/test/beast/_experimental/CMakeLists.txt b/test/beast/_experimental/CMakeLists.txt index 0e57763d..6aa942b7 100644 --- a/test/beast/_experimental/CMakeLists.txt +++ b/test/beast/_experimental/CMakeLists.txt @@ -15,7 +15,15 @@ add_executable(tests-beast-_experimental icy_stream.cpp stream.cpp) +source_group("" FILES + Jamfile + _test_detail_stream_state.cpp + error.cpp + icy_stream.cpp + stream.cpp) + target_link_libraries(tests-beast-_experimental + lib-asio-ssl lib-test) set_target_properties(tests-beast-_experimental diff --git a/test/beast/core/CMakeLists.txt b/test/beast/core/CMakeLists.txt index 3407b58b..f448affe 100644 --- a/test/beast/core/CMakeLists.txt +++ b/test/beast/core/CMakeLists.txt @@ -8,60 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -add_executable(tests-beast-core - Jamfile - test_buffer.hpp - file_test.hpp - stream_tests.hpp - test_handler.hpp - _detail_base64.cpp - _detail_bind_continuation.cpp - _detail_buffer.cpp - _detail_clamp.cpp - _detail_get_io_context.cpp - _detail_is_invocable.cpp - _detail_read.cpp - _detail_sha1.cpp - _detail_tuple.cpp - _detail_variant.cpp - _detail_varint.cpp - async_base.cpp - basic_stream.cpp - bind_handler.cpp - buffer_ref.cpp - buffer_traits.cpp - buffered_read_stream.cpp - buffers_adaptor.cpp - buffers_cat.cpp - buffers_generator.cpp - buffers_prefix.cpp - buffers_range.cpp - buffers_suffix.cpp - buffers_to_string.cpp - detect_ssl.cpp - error.cpp - file.cpp - file_base.cpp - file_posix.cpp - file_stdio.cpp - file_win32.cpp - filtering_cancellation_slot.cpp - flat_buffer.cpp - flat_static_buffer.cpp - flat_stream.cpp - make_printable.cpp - multi_buffer.cpp - ostream.cpp - rate_policy.cpp - read_size.cpp - role.cpp - saved_handler.cpp - span.cpp - static_buffer.cpp - static_string.cpp - stream_traits.cpp - string.cpp - tcp_stream.cpp) +file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS Jamfile *.cpp *.hpp) + +add_executable(tests-beast-core ${PFILES}) + +source_group("" FILES ${PFILES}) target_link_libraries(tests-beast-core lib-test diff --git a/test/beast/core/_detail_static_const.cpp b/test/beast/core/_detail_static_const.cpp deleted file mode 100644 index 9c15f42f..00000000 --- a/test/beast/core/_detail_static_const.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// -// Copyright (c) 2016-2017 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) -// -// Official repository: https://github.com/boostorg/beast -// - -// Test that header file is self-contained. -#include - -#include - -#include - -namespace boost { -namespace beast { - -struct foo_impl -{ - void operator()() const noexcept - { - BEAST_PASS(); - } -}; - -constexpr auto& bar = - boost::beast::detail::static_const::value; - -class static_const_test : public beast::unit_test::suite -{ -public: - void - run() override - { - pass(); - } -}; - -BEAST_DEFINE_TESTSUITE(beast,core,static_const); - -} // beast -} // boost diff --git a/test/beast/core/close_socket.cpp b/test/beast/core/close_socket.cpp deleted file mode 100644 index 01703c3f..00000000 --- a/test/beast/core/close_socket.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// -// Copyright (c) 2018 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) -// -// Official repository: https://github.com/boostorg/beast -// - -// Test that header file is self-contained. -#include - -#include -#include -#include -#include - -#include -#include -#include - -namespace boost { -namespace beast { - -class close_socket_test : public beast::unit_test::suite -{ -public: - void - run() override - { - testClose(); - testJavadocs(); - } -}; - -BEAST_DEFINE_TESTSUITE(beast,core,close_socket); - -} // beast -} // boost diff --git a/test/beast/core/make_strand.cpp b/test/beast/core/make_strand.cpp deleted file mode 100644 index fa06276d..00000000 --- a/test/beast/core/make_strand.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// -// Copyright (c) 2016-2019 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) -// -// Official repository: https://github.com/boostorg/beast -// - -// Test that header file is self-contained. -#include - -#include -#include -#include - -namespace boost { -namespace beast { - -class make_strand_test : public beast::unit_test::suite -{ -public: - void - testFunction() - { - net::io_context ioc; - net::make_strand(ioc); - net::make_strand(ioc.get_executor()); - net::make_strand(net::make_strand(ioc)); - - net::any_io_executor ex(ioc.get_executor()); - net::make_strand(ex); - - // this *should-not* compile - //net::make_strand(ex.context()); - } - - void - run() override - { - testFunction(); - pass(); - } -}; - -BEAST_DEFINE_TESTSUITE(beast,core,net::make_strand); - -} // beast -} // boost diff --git a/test/beast/core/prepare_buffers.cpp b/test/beast/core/prepare_buffers.cpp deleted file mode 100644 index 3a9902de..00000000 --- a/test/beast/core/prepare_buffers.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// -// Copyright (c) 2013-2017 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) -// -// Official repository: https://github.com/boostorg/beast -// - -// Test that header file is self-contained. -#include - diff --git a/test/beast/core/zlib.cpp b/test/beast/core/zlib.cpp deleted file mode 100644 index 6662e61c..00000000 --- a/test/beast/core/zlib.cpp +++ /dev/null @@ -1,235 +0,0 @@ -// -// Copyright (c) 2013-2017 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) -// -// Official repository: https://github.com/boostorg/beast -// - -// Test that header file is self-contained. -#include -#include - -#include -#include -#include -#include -#include - -namespace boost { -namespace beast { -namespace zlib { - -class zlib_test : public beast::unit_test::suite -{ -public: - class buffer - { - std::size_t size_ = 0; - std::size_t capacity_ = 0; - std::unique_ptr p_; - - public: - buffer() = default; - buffer(buffer&&) = default; - buffer& operator=(buffer&&) = default; - - - explicit - buffer(std::size_t capacity) - { - reserve(capacity); - } - - bool - empty() const - { - return size_ == 0; - } - - std::size_t - size() const - { - return size_; - } - - std::size_t - capacity() const - { - return capacity_; - } - - std::uint8_t const* - data() const - { - return p_.get(); - } - - std::uint8_t* - data() - { - return p_.get(); - } - - void - reserve(std::size_t capacity) - { - if(capacity != capacity_) - { - p_.reset(new std::uint8_t[capacity]); - capacity_ = capacity; - } - } - - void - resize(std::size_t size) - { - assert(size <= capacity_); - size_ = size; - } - }; - - buffer - make_source1(std::size_t size) - { - std::mt19937 rng; - buffer b(size); - auto p = b.data(); - std::size_t n = 0; - static std::string const chars( - "01234567890{}\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" - "{{{{{{{{{{}}}}}}}}}} "); - while(n < size) - { - *p++ = chars[rng()%chars.size()]; - ++n; - } - b.resize(n); - return b; - } - - buffer - make_source2(std::size_t size) - { - std::mt19937 rng; - std::array const i{0, 65535}; - std::array const w{0, 1}; - std::piecewise_linear_distribution d( - i.begin(), i.end(), w.begin()); - buffer b(size); - auto p = b.data(); - std::size_t n = 0; - while(n < size) - { - if(n == 1) - { - *p++ = rng()%256; - ++n; - continue; - } - auto const v = static_cast(d(rng)); - *p++ = v>>8; - *p++ = v&0xff; - n += 2; - - } - b.resize(n); - return b; - } - - void - checkInflate(buffer const& input, buffer const& original) - { - for(std::size_t i = 0; i < input.size(); ++i) - { - buffer output(original.size()); - inflate_stream zs; - zs.avail_in = 0; - zs.next_in = 0; - zs.next_out = output.data(); - zs.avail_out = output.capacity(); - if(i > 0) - { - zs.next_in = (Byte*)input.data(); - zs.avail_in = i; - auto result = zs.write(Z_FULL_FLUSH); - expect(result == Z_OK); - } - zs.next_in = (Byte*)input.data() + i; - zs.avail_in = input.size() - i; - auto result = zs.write(Z_FULL_FLUSH); - output.resize(output.capacity() - zs.avail_out); - expect(result == Z_OK); - expect(output.size() == original.size()); - expect(std::memcmp( - output.data(), original.data(), original.size()) == 0); - } - } - - void testSpecial() - { - { - deflate_stream zs; - } - { - inflate_stream zs; - } - } - - void testCompress() - { - static std::size_t constexpr N = 2048; - for(int source = 0; source <= 1; ++source) - { - buffer original; - switch(source) - { - case 0: - original = make_source1(N); - break; - case 1: - original = make_source2(N); - break; - } - for(int level = 0; level <= 9; ++level) - { - for(int strategy = 0; strategy <= 4; ++strategy) - { - for(int wbits = 15; wbits <= 15; ++wbits) - { - deflate_stream zs; - zs.avail_in = 0; - zs.next_in = 0; - expect(deflate_stream::deflateInit2(&zs, - level, - wbits, - 4, - strategy) == Z_OK); - buffer output(deflate_stream::deflateBound(&zs, original.size())); - zs.next_in = (Byte*)original.data(); - zs.avail_in = original.size(); - zs.next_out = output.data(); - zs.avail_out = output.capacity(); - auto result = zs.deflate(Z_FULL_FLUSH); - expect(result == Z_OK); - output.resize(output.capacity() - zs.avail_out); - checkInflate(output, original); - } - } - } - } - } - - void run() override - { - testSpecial(); - testCompress(); - } -}; - -BEAST_DEFINE_TESTSUITE(zlib,core,beast); - -} // zlib -} // beast -} // boost diff --git a/test/beast/http/CMakeLists.txt b/test/beast/http/CMakeLists.txt index 9931f7e3..a27cc758 100644 --- a/test/beast/http/CMakeLists.txt +++ b/test/beast/http/CMakeLists.txt @@ -8,49 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -add_executable (tests-beast-http - Jamfile - any_completion_handler.cpp - basic_dynamic_body_fwd.cpp - basic_dynamic_body.cpp - basic_file_body_fwd.cpp - basic_file_body.cpp - basic_parser.cpp - buffer_body_fwd.cpp - buffer_body.cpp - chunk_encode.cpp - deferred.cpp - dynamic_body_fwd.cpp - dynamic_body.cpp - empty_body_fwd.cpp - empty_body.cpp - error.cpp - field_compiles.cpp - field.cpp - fields_fwd.cpp - fields.cpp - file_body_fwd.cpp - file_body.cpp - message_fwd.cpp - message_generator_fwd.cpp - message_generator.cpp - message.cpp - parser_fwd.cpp - parser.cpp - read.cpp - rfc7230.cpp - serializer_fwd.cpp - serializer.cpp - span_body_fwd.cpp - span_body.cpp - status.cpp - string_body_fwd.cpp - string_body.cpp - type_traits.cpp - vector_body_fwd.cpp - vector_body.cpp - verb.cpp - write.cpp) +file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS Jamfile *.cpp *.hpp) + +add_executable(tests-beast-http ${PFILES}) + +source_group("" FILES ${PFILES}) target_link_libraries(tests-beast-http lib-test diff --git a/test/beast/ssl/CMakeLists.txt b/test/beast/ssl/CMakeLists.txt index 5bba3780..aa415741 100644 --- a/test/beast/ssl/CMakeLists.txt +++ b/test/beast/ssl/CMakeLists.txt @@ -11,6 +11,10 @@ add_executable (tests-beast-ssl Jamfile ssl_stream.cpp) +source_group("" FILES + Jamfile + ssl_stream.cpp) + target_link_libraries(tests-beast-ssl lib-asio-ssl lib-test) diff --git a/test/beast/websocket/CMakeLists.txt b/test/beast/websocket/CMakeLists.txt index 0fbc8150..a6b5a50d 100644 --- a/test/beast/websocket/CMakeLists.txt +++ b/test/beast/websocket/CMakeLists.txt @@ -8,36 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -add_executable (tests-beast-websocket - Jamfile - _detail_decorator.cpp - _detail_prng.cpp - _detail_impl_base.cpp - test.hpp - _detail_prng.cpp - any_completion_handler.cpp - accept.cpp - cancel.cpp - close.cpp - deferred.cpp - error.cpp - frame.cpp - handshake.cpp - option.cpp - ping.cpp - read1.cpp - read2.cpp - read3.cpp - rfc6455.cpp - ssl.cpp - stream.cpp - stream_base.cpp - stream_explicit.cpp - stream_fwd.cpp - teardown.cpp - timer.cpp - utf8_checker.cpp - write.cpp) +file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS Jamfile *.cpp *.hpp) + +add_executable(tests-beast-websocket ${PFILES}) + +source_group("" FILES ${PFILES}) target_link_libraries(tests-beast-websocket lib-asio-ssl diff --git a/test/beast/websocket/doc_snippets.cpp b/test/beast/websocket/doc_snippets.cpp deleted file mode 100644 index 4e8ae0ea..00000000 --- a/test/beast/websocket/doc_snippets.cpp +++ /dev/null @@ -1,285 +0,0 @@ -// -// Copyright (c) 2016-2017 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) -// -// Official repository: https://github.com/boostorg/beast -// - -#include -#include -#include -#include -#include -#include -#include -#include - -//[ws_snippet_1 -#include -using namespace boost::beast::websocket; -//] - -using namespace boost::beast; - -namespace doc_ws_snippets { - -void fxx() { - -net::io_service ios; -net::io_service::work work{ios}; -std::thread t{[&](){ ios.run(); }}; -error_code ec; -net::ip::tcp::socket sock{ios}; - -{ -//[ws_snippet_2 - stream ws{ios}; -//] -} - -{ -//[ws_snippet_3 - stream ws{std::move(sock)}; -//] -} - -{ -//[ws_snippet_4 - stream ws{sock}; -//] - -//[ws_snippet_5 - ws.next_layer().shutdown(net::ip::tcp::socket::shutdown_send); -//] -} - -{ -//[ws_snippet_6 - std::string const host = "mywebapp.com"; - net::ip::tcp::resolver r{ios}; - stream ws{ios}; - net::connect(ws.next_layer(), r.resolve({host, "ws"})); -//] -} - -{ -//[ws_snippet_7 - net::ip::tcp::acceptor acceptor{ios}; - stream ws{acceptor.get_io_service()}; - acceptor.accept(ws.next_layer()); -//] -} - -{ - stream ws{ios}; -//[ws_snippet_8 - ws.handshake("localhost", "/"); -//] - -//[ws_snippet_9 - ws.handshake_ex("localhost", "/", - [](request_type& m) - { - m.insert(http::field::sec_websocket_protocol, "xmpp;ws-chat"); - }); -//] - -//[ws_snippet_10 - response_type res; - ws.handshake(res, "localhost", "/"); - if(! res.count(http::field::sec_websocket_protocol)) - throw std::invalid_argument("missing subprotocols"); -//] - -//[ws_snippet_11 - ws.accept(); -//] - -//[ws_snippet_12 - ws.accept_ex( - [](response_type& m) - { - m.insert(http::field::server, "MyServer"); - }); -//] -} - -{ -//[ws_snippet_13] - // Buffer required for reading HTTP messages - flat_buffer buffer; - - // Read the HTTP request ourselves - http::request req; - http::read(sock, buffer, req); - - // See if its a WebSocket upgrade request - if(websocket::is_upgrade(req)) - { - // Construct the stream, transferring ownership of the socket - stream ws{std::move(sock)}; - - // Accept the request from our message. Clients SHOULD NOT - // begin sending WebSocket frames until the server has - // provided a response, but just in case they did, we pass - // any leftovers in the buffer to the accept function. - // - ws.accept(req, buffer.data()); - } - else - { - // Its not a WebSocket upgrade, so - // handle it like a normal HTTP request. - } -//] -} - -{ - stream ws{ios}; -//[ws_snippet_14 - // Read into our buffer until we reach the end of the HTTP request. - // No parsing takes place here, we are just accumulating data. - net::streambuf buffer; - net::read_until(sock, buffer, "\r\n\r\n"); - - // Now accept the connection, using the buffered data. - ws.accept(buffer.data()); -//] -} -{ - stream ws{ios}; -//[ws_snippet_15 - multi_buffer buffer; - ws.read(buffer); - - ws.text(ws.got_text()); - ws.write(buffer.data()); - buffer.consume(buffer.size()); -//] -} - -{ - stream ws{ios}; -//[ws_snippet_16 - multi_buffer buffer; - for(;;) - if(ws.read_some(buffer, 0)) - break; - ws.binary(ws.got_binary()); - consuming_buffers cb{buffer.data()}; - for(;;) - { - using net::buffer_size; - if(buffer_size(cb) > 512) - { - ws.write_some(false, buffer_prefix(512, cb)); - cb.consume(512); - } - else - { - ws.write_some(true, cb); - break; - } - } -//] -} - -{ - stream ws{ios}; -//[ws_snippet_17 - auto cb = - [](frame_type kind, string_view payload) - { - // Do something with the payload - boost::ignore_unused(kind, payload); - }; - ws.control_callback(cb); -//] - -//[ws_snippet_18 - ws.close(close_code::normal); -//] - -//[ws_snippet_19 - ws.auto_fragment(true); - ws.write_buffer_size(16384); -//] - -//[ws_snippet_20 - multi_buffer buffer; - ws.async_read(buffer, - [](error_code, std::size_t) - { - // Do something with the buffer - }); -//] -} - -} // fxx() - -// workaround for https://github.com/chriskohlhoff/asio/issues/112 -#ifdef BOOST_MSVC -//[ws_snippet_21 -void echo(stream& ws, - multi_buffer& buffer, net::yield_context yield) -{ - ws.async_read(buffer, yield); - std::future fut = - ws.async_write(buffer.data(), net::use_future); -} -//] -#endif - -} // doc_ws_snippets - -//------------------------------------------------------------------------------ - -#if BOOST_BEAST_USE_OPENSSL - -//[wss_snippet_1 -#include -#include -//] - -namespace doc_wss_snippets { - -void fxx() { - -net::io_service ios; -net::io_service::work work{ios}; -std::thread t{[&](){ ios.run(); }}; -error_code ec; -net::ip::tcp::socket sock{ios}; - -{ -//[wss_snippet_2 - net::ssl::context ctx{net::ssl::context::tlsv12}; - stream> wss{ios, ctx}; -//] -} - -{ -//[wss_snippet_3 - net::ip::tcp::endpoint ep; - net::ssl::context ctx{net::ssl::context::tlsv12}; - stream> ws{ios, ctx}; - - // connect the underlying TCP/IP socket - ws.next_layer().next_layer().connect(ep); - - // perform SSL handshake - ws.next_layer().handshake(net::ssl::stream_base::client); - - // perform WebSocket handshake - ws.handshake("localhost", "/"); -//] -} - -} // fxx() - -} // doc_wss_snippets - -#endif - diff --git a/test/beast/zlib/CMakeLists.txt b/test/beast/zlib/CMakeLists.txt index b330d4c6..238b1f5b 100644 --- a/test/beast/zlib/CMakeLists.txt +++ b/test/beast/zlib/CMakeLists.txt @@ -8,7 +8,14 @@ # Official repository: https://github.com/boostorg/beast # -add_executable (tests-beast-zlib +add_executable(tests-beast-zlib + Jamfile + error.cpp + deflate_stream.cpp + inflate_stream.cpp + zlib.cpp) + +source_group("" FILES Jamfile error.cpp deflate_stream.cpp diff --git a/test/bench/buffers/CMakeLists.txt b/test/bench/buffers/CMakeLists.txt index 93b2e427..9f0f1862 100644 --- a/test/bench/buffers/CMakeLists.txt +++ b/test/bench/buffers/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(bench-buffers Jamfile bench_buffers.cpp) +source_group("" FILES + Jamfile + bench_buffers.cpp) + target_link_libraries(bench-buffers lib-test) diff --git a/test/bench/parser/CMakeLists.txt b/test/bench/parser/CMakeLists.txt index 29856ecf..ead38bd3 100644 --- a/test/bench/parser/CMakeLists.txt +++ b/test/bench/parser/CMakeLists.txt @@ -14,6 +14,12 @@ add_executable(bench-parser nodejs_parser.cpp bench_parser.cpp) +source_group("" FILES + Jamfile + nodejs_parser.hpp + nodejs_parser.cpp + bench_parser.cpp) + target_include_directories(bench-parser PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/test/bench/utf8_checker/CMakeLists.txt b/test/bench/utf8_checker/CMakeLists.txt index 37147c21..9a72d41f 100644 --- a/test/bench/utf8_checker/CMakeLists.txt +++ b/test/bench/utf8_checker/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(bench-utf8-checker Jamfile bench_utf8_checker.cpp) +source_group("" FILES + Jamfile + bench_utf8_checker.cpp) + target_link_libraries(bench-utf8-checker lib-test) diff --git a/test/bench/wsload/CMakeLists.txt b/test/bench/wsload/CMakeLists.txt index 52d7e04e..ce5743ac 100644 --- a/test/bench/wsload/CMakeLists.txt +++ b/test/bench/wsload/CMakeLists.txt @@ -12,6 +12,10 @@ add_executable(bench-wsload Jamfile wsload.cpp) +source_group("" FILES + Jamfile + wsload.cpp) + target_link_libraries(bench-wsload lib-beast) diff --git a/test/bench/zlib/CMakeLists.txt b/test/bench/zlib/CMakeLists.txt index 308433e3..c7ba626a 100644 --- a/test/bench/zlib/CMakeLists.txt +++ b/test/bench/zlib/CMakeLists.txt @@ -8,7 +8,12 @@ # Official repository: https://github.com/boostorg/beast # -add_executable (bench-zlib +add_executable(bench-zlib + Jamfile + deflate_stream.cpp + inflate_stream.cpp) + +source_group("" FILES Jamfile deflate_stream.cpp inflate_stream.cpp) diff --git a/test/cmake_test/CMakeLists.txt b/test/cmake_test/CMakeLists.txt index 55a0081f..4872e3dd 100644 --- a/test/cmake_test/CMakeLists.txt +++ b/test/cmake_test/CMakeLists.txt @@ -86,6 +86,7 @@ else() endif() add_executable(main main.cpp) +source_group("" FILES main.cpp) target_link_libraries(main Boost::beast) enable_testing() diff --git a/test/doc/CMakeLists.txt b/test/doc/CMakeLists.txt index 251e40c2..fdb04c29 100644 --- a/test/doc/CMakeLists.txt +++ b/test/doc/CMakeLists.txt @@ -8,28 +8,11 @@ # Official repository: https://github.com/boostorg/beast # -add_executable (tests-doc - Jamfile - snippets.hpp - snippets.ipp - core_snippets.cpp - core_1_refresher.cpp - core_3_timeouts.cpp - core_4_layers.cpp - http_10_custom_parser.cpp - http_examples.cpp - http_snippets.cpp - websocket_common.ipp - websocket.cpp - websocket_1_connecting.cpp - websocket_2_handshaking.cpp - websocket_3_decorator.cpp - websocket_4_messages.cpp - websocket_5_control_frames.cpp - websocket_6_timeouts.cpp - websocket_7_teardown.cpp - websocket_8_notes.cpp - exemplars.cpp) +file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS Jamfile *.cpp *.ipp *.hpp) + +add_executable(tests-doc ${PFILES}) + +source_group("" FILES ${PFILES}) target_include_directories(tests-doc PRIVATE ${PROJECT_SOURCE_DIR}) diff --git a/test/example/common/CMakeLists.txt b/test/example/common/CMakeLists.txt index a28426c8..a19d863b 100644 --- a/test/example/common/CMakeLists.txt +++ b/test/example/common/CMakeLists.txt @@ -8,7 +8,12 @@ # Official repository: https://github.com/boostorg/beast # -add_executable (tests-example-common +add_executable(tests-example-common + Jamfile + root_certificates.cpp + server_certificate.cpp) + +source_group("" FILES Jamfile root_certificates.cpp server_certificate.cpp) diff --git a/test/fuzz/CMakeLists.txt b/test/fuzz/CMakeLists.txt index c9bd8785..af162300 100644 --- a/test/fuzz/CMakeLists.txt +++ b/test/fuzz/CMakeLists.txt @@ -71,6 +71,7 @@ function(add_boost_beast_fuzzer NAME) # Fuzzer executable set(SOURCE_FILES ${ARGN}) add_executable(fuzzer_${NAME} ${SOURCE_FILES}) + source_group("" FILES ${SOURCE_FILES}) target_link_libraries(fuzzer_${NAME} PRIVATE lib-beast) target_compile_options(fuzzer_${NAME} PRIVATE -g -O2 -fsanitize=fuzzer,address,undefined -fno-sanitize-recover=undefined) target_link_libraries(fuzzer_${NAME} PRIVATE -fsanitize=fuzzer,address,undefined)