feat add inja
This commit is contained in:
parent
f15f564b37
commit
a9e041dca6
3288
3party/inja/inja.hpp
Normal file
3288
3party/inja/inja.hpp
Normal file
File diff suppressed because it is too large
Load Diff
24765
3party/nlohmann/nlohmann/json.hpp
Normal file
24765
3party/nlohmann/nlohmann/json.hpp
Normal file
File diff suppressed because it is too large
Load Diff
@ -80,7 +80,11 @@ target_sources(${PROJECT_NAME} PRIVATE
|
|||||||
)
|
)
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC fmt::fmt jsoncpp_static)
|
target_link_libraries(${PROJECT_NAME} PUBLIC fmt::fmt jsoncpp_static)
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE ULIB_LIBRARY_IMPL)
|
target_compile_definitions(${PROJECT_NAME} PRIVATE ULIB_LIBRARY_IMPL)
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC src)
|
target_include_directories(${PROJECT_NAME} PUBLIC
|
||||||
|
3party/nlohmann
|
||||||
|
3party/inja
|
||||||
|
src
|
||||||
|
)
|
||||||
|
|
||||||
install(TARGETS ${PROJECT_NAME} DESTINATION lib)
|
install(TARGETS ${PROJECT_NAME} DESTINATION lib)
|
||||||
|
|
||||||
|
11
tests/3party/inja/inja_unittest.cpp
Normal file
11
tests/3party/inja/inja_unittest.cpp
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include <gtest/gtest.h>
|
||||||
|
#include <inja.hpp>
|
||||||
|
|
||||||
|
TEST(inja, base)
|
||||||
|
{
|
||||||
|
inja::json data;
|
||||||
|
data["name"] = "world";
|
||||||
|
|
||||||
|
std::string str = inja::render("Hello {{ name }}", data);
|
||||||
|
EXPECT_EQ(str, "Hello world");
|
||||||
|
}
|
@ -10,6 +10,7 @@ add_executable(ulib_test
|
|||||||
ulib/system/thread_unittest.cpp
|
ulib/system/thread_unittest.cpp
|
||||||
ulib/system/thread_pool_unittest.cpp
|
ulib/system/thread_pool_unittest.cpp
|
||||||
ulib/system/timer_unittest.cpp
|
ulib/system/timer_unittest.cpp
|
||||||
|
3party/inja/inja_unittest.cpp
|
||||||
)
|
)
|
||||||
target_link_libraries(ulib_test PRIVATE
|
target_link_libraries(ulib_test PRIVATE
|
||||||
ulib
|
ulib
|
||||||
|
Loading…
x
Reference in New Issue
Block a user