Skip to content

Commit

Permalink
fix benchmark includes, resolves #286
Browse files Browse the repository at this point in the history
  • Loading branch information
pantor committed Oct 5, 2024
1 parent 8695d75 commit fddbfce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ if(BUILD_TESTING AND INJA_BUILD_TESTS)

add_executable(inja_benchmark test/benchmark.cpp)
target_link_libraries(inja_benchmark PRIVATE inja)
target_include_directories(inja_benchmark PRIVATE third_party/include)
endif()


Expand Down
10 changes: 5 additions & 5 deletions test/benchmark.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Copyright (c) 2020 Pantor. All rights reserved.

#include "hayai/hayai.hpp"
#include <hayai/hayai.hpp>
#include <inja/inja.hpp>

inja::Environment env;

const std::string test_file_directory {"../test/data/benchmark/"};

auto small_data = env.load_json(test_file_directory + "small_data.json");
auto large_data = env.load_json(test_file_directory + "large_data.json");
std::string medium_template = env.load_file(test_file_directory + "medium_template.txt");
std::string large_template = env.load_file(test_file_directory + "large_template.txt");
const auto small_data = env.load_json(test_file_directory + "small_data.json");
const auto large_data = env.load_json(test_file_directory + "large_data.json");
const std::string medium_template = env.load_file(test_file_directory + "medium_template.txt");
const std::string large_template = env.load_file(test_file_directory + "large_template.txt");

BENCHMARK(SmallDataMediumTemplate, render, 5, 30) {
env.render(medium_template, small_data);
Expand Down

0 comments on commit fddbfce

Please sign in to comment.