Initial http implementation
This commit is contained in:
@@ -128,13 +128,14 @@ set(SOURCES
|
||||
src/connection.cpp
|
||||
src/server.cpp
|
||||
src/json_commit_request_parser.cpp
|
||||
src/http_handler.cpp
|
||||
src/arena_allocator.cpp
|
||||
${CMAKE_BINARY_DIR}/json_tokens.cpp)
|
||||
|
||||
add_executable(weaseldb ${SOURCES})
|
||||
add_dependencies(weaseldb generate_json_tokens)
|
||||
target_link_libraries(weaseldb Threads::Threads toml11::toml11 weaseljson
|
||||
simdutf::simdutf)
|
||||
simdutf::simdutf llhttp_static)
|
||||
|
||||
enable_testing()
|
||||
|
||||
@@ -158,6 +159,15 @@ target_link_libraries(test_commit_request doctest::doctest weaseljson test_data
|
||||
nlohmann_json::nlohmann_json simdutf::simdutf)
|
||||
target_include_directories(test_commit_request PRIVATE src tests)
|
||||
|
||||
add_executable(
|
||||
test_http_handler tests/test_http_handler.cpp src/http_handler.cpp
|
||||
src/arena_allocator.cpp src/connection.cpp)
|
||||
target_link_libraries(test_http_handler doctest::doctest llhttp_static
|
||||
Threads::Threads)
|
||||
target_include_directories(test_http_handler PRIVATE src)
|
||||
target_compile_definitions(test_http_handler
|
||||
PRIVATE DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN)
|
||||
|
||||
add_executable(bench_arena_allocator benchmarks/bench_arena_allocator.cpp
|
||||
src/arena_allocator.cpp)
|
||||
target_link_libraries(bench_arena_allocator nanobench)
|
||||
@@ -192,6 +202,7 @@ target_include_directories(debug_arena PRIVATE src)
|
||||
|
||||
add_test(NAME arena_allocator_tests COMMAND test_arena_allocator)
|
||||
add_test(NAME commit_request_tests COMMAND test_commit_request)
|
||||
add_test(NAME http_handler_tests COMMAND test_http_handler)
|
||||
add_test(NAME arena_allocator_benchmarks COMMAND bench_arena_allocator)
|
||||
add_test(NAME commit_request_benchmarks COMMAND bench_commit_request)
|
||||
add_test(NAME parser_comparison_benchmarks COMMAND bench_parser_comparison)
|
||||
|
||||
Reference in New Issue
Block a user