mirror of
https://github.com/pantor/inja.git
synced 2026-10-05 20:10:36 +00:00
fix benchmark includes, resolves #286
This commit is contained in:
@@ -106,6 +106,7 @@ if(BUILD_TESTING AND INJA_BUILD_TESTS)
|
|||||||
|
|
||||||
add_executable(inja_benchmark test/benchmark.cpp)
|
add_executable(inja_benchmark test/benchmark.cpp)
|
||||||
target_link_libraries(inja_benchmark PRIVATE inja)
|
target_link_libraries(inja_benchmark PRIVATE inja)
|
||||||
|
target_include_directories(inja_benchmark PRIVATE third_party/include)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (c) 2020 Pantor. All rights reserved.
|
// Copyright (c) 2020 Pantor. All rights reserved.
|
||||||
|
|
||||||
#include "hayai/hayai.hpp"
|
#include <hayai/hayai.hpp>
|
||||||
#include <inja/inja.hpp>
|
#include <inja/inja.hpp>
|
||||||
|
|
||||||
inja::Environment env;
|
inja::Environment env;
|
||||||
|
|
||||||
const std::string test_file_directory {"../test/data/benchmark/"};
|
const std::string test_file_directory {"../test/data/benchmark/"};
|
||||||
|
|
||||||
auto small_data = env.load_json(test_file_directory + "small_data.json");
|
const auto small_data = env.load_json(test_file_directory + "small_data.json");
|
||||||
auto large_data = env.load_json(test_file_directory + "large_data.json");
|
const 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");
|
const 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 std::string large_template = env.load_file(test_file_directory + "large_template.txt");
|
||||||
|
|
||||||
BENCHMARK(SmallDataMediumTemplate, render, 5, 30) {
|
BENCHMARK(SmallDataMediumTemplate, render, 5, 30) {
|
||||||
env.render(medium_template, small_data);
|
env.render(medium_template, small_data);
|
||||||
|
|||||||
Reference in New Issue
Block a user