Skip to content
Merged

stuff #252

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 25,
"patch": 0
},
"configurePresets": [],
"buildPresets": []
Comment on lines +1 to +9
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Search for cmake_minimum_required in CMakeLists.txt
echo "=== CMakeLists.txt cmake_minimum_required ===" 
rg -n "cmake_minimum_required" --type cmake

# Search for cmake version references in CI workflows
echo -e "\n=== CI workflows (yml/yaml) with cmake references ==="
rg -n "cmake" -t yaml | head -50

# Search for cmake in README files
echo -e "\n=== README files mentioning cmake ==="
rg -n -i "cmake" -g "README*" | head -30

# Check if CMakePresets.json exists and confirm version
echo -e "\n=== CMakePresets.json details ==="
find . -name "CMakePresets.json" -type f | head -5

Repository: cppalliance/http

Length of output: 507


CMakePresets.json version 6 conflicts with CMakeLists.txt version constraints.

CMakePresets version 6 requires CMake 3.25+, but CMakeLists.txt specifies a maximum of 3.20 (cmake_minimum_required(VERSION 3.8...3.20)). Either update CMakeLists.txt to allow CMake 3.25+, or downgrade CMakePresets.json to a version compatible with CMake 3.20 or earlier.

🤖 Prompt for AI Agents
In `@CMakePresets.json` around lines 1 - 9, CMakePresets.json declares "version":
6 and cmakeMinimumRequired 3.25.0 which conflicts with the upper bound in
CMakeLists.txt (cmake_minimum_required(VERSION 3.8...3.20)); either make the
preset compatible with the project's allowed CMake range or relax the project's
CMake constraint. Fix by choosing one: (A) update CMakeLists.txt's
cmake_minimum_required range to include 3.25 (remove or raise the upper bound so
3.25+ is allowed), or (B) downgrade CMakePresets.json to a preset version
compatible with CMake 3.20 (change "version" and/or cmakeMinimumRequired to 3.20
or lower) so the preset and CMakeLists.txt agree.

}
1 change: 0 additions & 1 deletion src/server/route_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <boost/http/server/route_handler.hpp>
#include <boost/http/string_body.hpp>
#include <boost/capy/ex/run_sync.hpp>

namespace boost {
namespace http {
Expand Down
10 changes: 5 additions & 5 deletions test/unit/server/flat_router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// Full functional tests are in beast2/test/unit/server/router.cpp

#include <boost/http/server/router.hpp>
#include <boost/capy/ex/run_sync.hpp>

#include <boost/capy/test/run_blocking.hpp>
#include "test_suite.hpp"

namespace boost {
Expand All @@ -39,11 +39,11 @@ struct flat_router_test
flat_router fr2(fr1);

params req;
capy::run_sync()(fr1.dispatch(
capy::test::run_blocking()(fr1.dispatch(
http::method::get, urls::url_view("/"), req));
BOOST_TEST_EQ(*counter, 1);

capy::run_sync()(fr2.dispatch(
capy::test::run_blocking()(fr2.dispatch(
http::method::get, urls::url_view("/"), req));
BOOST_TEST_EQ(*counter, 2);
}
Expand All @@ -70,11 +70,11 @@ struct flat_router_test
fr2 = fr1;

params req;
capy::run_sync()(fr1.dispatch(
capy::test::run_blocking()(fr1.dispatch(
http::method::get, urls::url_view("/"), req));
BOOST_TEST_EQ(*counter, 1);

capy::run_sync()(fr2.dispatch(
capy::test::run_blocking()(fr2.dispatch(
http::method::get, urls::url_view("/"), req));
BOOST_TEST_EQ(*counter, 2);
}
Expand Down
14 changes: 11 additions & 3 deletions test/unit/server/route_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@
#include <boost/http/server/router.hpp>
#include <boost/http/server/flat_router.hpp>
#include <boost/http/request.hpp>
#include <boost/capy/ex/run_sync.hpp>

#include <boost/capy/test/run_blocking.hpp>
#include "test_route_handler.hpp"
#include "test_suite.hpp"

#include <array>

namespace boost {
namespace http {

struct any_write_buffers
{
std::array<capy::const_buffer, 16> v_;
};

struct route_handler_test
{
using test_router = router<route_params>;
Expand All @@ -33,8 +40,9 @@ struct route_handler_test
{
flat_router fr(std::move(r));
test_route_params p;
auto rv = capy::run_sync()(fr.dispatch(
verb, urls::url_view(url), p));
route_result rv;
capy::test::run_blocking([&](route_result r) { rv = r; })(
fr.dispatch(verb, urls::url_view(url), p));
if(BOOST_TEST_EQ(rv.message(), rv0.message()))
BOOST_TEST(rv == rv0);
}
Expand Down
22 changes: 12 additions & 10 deletions test/unit/server/router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
#include <boost/http/server/flat_router.hpp>
#include <boost/http/server/detail/router_base.hpp>

#include <boost/capy/ex/run_sync.hpp>

#include <boost/capy/test/run_blocking.hpp>
#include "test_suite.hpp"

namespace boost {
Expand Down Expand Up @@ -108,8 +107,9 @@ struct router_test
{
flat_router fr(std::move(r));
params req;
auto rv = capy::run_sync()(fr.dispatch(
http::method::get, urls::url_view(url), req));
route_result rv;
capy::test::run_blocking([&](route_result res) { rv = res; })(
fr.dispatch(http::method::get, urls::url_view(url), req));
BOOST_TEST_EQ(rv.message(), rv0.message());
}

Expand All @@ -121,8 +121,9 @@ struct router_test
{
flat_router fr(std::move(r));
params req;
auto rv = capy::run_sync()(fr.dispatch(
verb, urls::url_view(url), req));
route_result rv;
capy::test::run_blocking([&](route_result res) { rv = res; })(
fr.dispatch(verb, urls::url_view(url), req));
BOOST_TEST_EQ(rv.message(), rv0.message());
}

Expand All @@ -134,8 +135,9 @@ struct router_test
{
flat_router fr(std::move(r));
params req;
auto rv = capy::run_sync()(fr.dispatch(
verb, urls::url_view(url), req));
route_result rv;
capy::test::run_blocking([&](route_result res) { rv = res; })(
fr.dispatch(verb, urls::url_view(url), req));
BOOST_TEST_EQ(rv.message(), rv0.message());
}

Expand Down Expand Up @@ -411,7 +413,7 @@ struct router_test
flat_router fr(std::move(r));
params req;
BOOST_TEST_THROWS(
capy::run_sync()(fr.dispatch(
capy::test::run_blocking()(fr.dispatch(
http::method::unknown, urls::url_view("/"), req)),
std::invalid_argument);
}
Expand All @@ -423,7 +425,7 @@ struct router_test
flat_router fr(std::move(r));
params req;
BOOST_TEST_THROWS(
capy::run_sync()(fr.dispatch(
capy::test::run_blocking()(fr.dispatch(
"", urls::url_view("/"), req)),
std::invalid_argument);
}
Expand Down
Loading