From b5cb4d2a81e9050814b66990d871fc38152ec77e Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Mon, 18 Aug 2025 06:38:18 -0400 Subject: [PATCH] Reorganize Test-only code to tests Rename interface to CommitRequestParser --- CMakeLists.txt | 4 ++-- src/{parser_interface.hpp => commit_request_parser.hpp} | 0 src/json_commit_request_parser.hpp | 2 +- {src => tests}/nlohmann_reference_parser.cpp | 4 +--- {src => tests}/nlohmann_reference_parser.hpp | 0 {src => tests}/parser_comparison.cpp | 0 {src => tests}/parser_comparison.hpp | 0 7 files changed, 4 insertions(+), 6 deletions(-) rename src/{parser_interface.hpp => commit_request_parser.hpp} (100%) rename {src => tests}/nlohmann_reference_parser.cpp (99%) rename {src => tests}/nlohmann_reference_parser.hpp (100%) rename {src => tests}/parser_comparison.cpp (100%) rename {src => tests}/parser_comparison.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc59f4b..38b165d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,12 +110,12 @@ target_include_directories(test_arena_allocator PRIVATE src) add_executable( test_commit_request tests/test_commit_request.cpp src/json_commit_request_parser.cpp - src/nlohmann_reference_parser.cpp src/parser_comparison.cpp + tests/nlohmann_reference_parser.cpp tests/parser_comparison.cpp src/arena_allocator.cpp ${CMAKE_BINARY_DIR}/json_tokens.cpp) add_dependencies(test_commit_request generate_json_tokens) 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) +target_include_directories(test_commit_request PRIVATE src tests) add_executable(bench_arena_allocator benchmarks/bench_arena_allocator.cpp src/arena_allocator.cpp) diff --git a/src/parser_interface.hpp b/src/commit_request_parser.hpp similarity index 100% rename from src/parser_interface.hpp rename to src/commit_request_parser.hpp diff --git a/src/json_commit_request_parser.hpp b/src/json_commit_request_parser.hpp index ab31d39..e660360 100644 --- a/src/json_commit_request_parser.hpp +++ b/src/json_commit_request_parser.hpp @@ -1,7 +1,7 @@ #pragma once +#include "commit_request_parser.hpp" #include "json_token_enum.hpp" -#include "parser_interface.hpp" #include #include #include diff --git a/src/nlohmann_reference_parser.cpp b/tests/nlohmann_reference_parser.cpp similarity index 99% rename from src/nlohmann_reference_parser.cpp rename to tests/nlohmann_reference_parser.cpp index 06d0491..d515535 100644 --- a/src/nlohmann_reference_parser.cpp +++ b/tests/nlohmann_reference_parser.cpp @@ -1,6 +1,4 @@ #include "nlohmann_reference_parser.hpp" -#include -#include #include NlohmannReferenceParser::ParseResult @@ -266,4 +264,4 @@ NlohmannReferenceParser::parse_operation_type(const std::string &type_str) { } // Default fallback (should not happen if validation is correct) return Operation::Type::Write; -} \ No newline at end of file +} diff --git a/src/nlohmann_reference_parser.hpp b/tests/nlohmann_reference_parser.hpp similarity index 100% rename from src/nlohmann_reference_parser.hpp rename to tests/nlohmann_reference_parser.hpp diff --git a/src/parser_comparison.cpp b/tests/parser_comparison.cpp similarity index 100% rename from src/parser_comparison.cpp rename to tests/parser_comparison.cpp diff --git a/src/parser_comparison.hpp b/tests/parser_comparison.hpp similarity index 100% rename from src/parser_comparison.hpp rename to tests/parser_comparison.hpp