request parser rewrite + added tests
Some checks failed
Docker Build & Publish / build (push) Failing after 11m2s

* rewrote request parser, now more simplified and theoretically faster
* added gtest and an example test to measure parser times
This commit is contained in:
Nicholas Orlowsky 2025-02-04 18:27:33 -05:00
parent f962f5796d
commit 236f7399fe
Signed by: nickorlow
GPG key ID: 838827D8C4611687
5 changed files with 184 additions and 108 deletions

View file

@ -15,7 +15,7 @@ add_custom_target(build-version
add_custom_target(build-supplemental
COMMAND cd ../build_supp && python3 ./error_gen.py
COMMAND mkdir www && cp -r ../default_www/regular/* ./www/
COMMAND mkdir -p www && cp -r ../default_www/regular/* ./www/
DEPENDS build_supp/version.txt ../default_www/regular/* build_supp/error_gen.py build-version
COMMENT "Generated supplemental build files (default www dir + error pages)"
)
@ -38,3 +38,38 @@ add_dependencies(anthracite-bin anthracite)
add_executable(anthracite-api-bin src/api_main.cpp)
target_link_libraries(anthracite-api-bin anthracite)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
FetchContent_MakeAvailable(googletest)
file(GLOB TESTS_SRC CONFIGURE_DEPENDS "tests/*.cpp")
enable_testing()
add_custom_target(test_files
COMMAND cp -r ../tests/test_files .
DEPENDS ../tests/test_files/*
COMMENT "Copied test resource files"
)
add_executable(
tests
${TESTS_SRC}
)
add_dependencies(tests anthracite)
add_dependencies(tests test_files)
target_link_libraries(
tests
GTest::gtest_main
)
target_link_libraries(
tests
anthracite
)
include(GoogleTest)
gtest_discover_tests(tests)