diff --git a/.clang-format b/.clang-format deleted file mode 100644 index 3a48294..0000000 --- a/.clang-format +++ /dev/null @@ -1,14 +0,0 @@ ---- -BasedOnStyle: LLVM -IndentWidth: 2 -ColumnLimit: 160 - ---- -Language: Cpp - -SpaceBeforeCpp11BracedList: true -PointerAlignment: Left -AllowShortFunctionsOnASingleLine: Empty -AllowShortBlocksOnASingleLine: Empty -SpaceBeforeCtorInitializerColon: false -... diff --git a/.gitignore b/.gitignore index 88d9a4d..8532006 100644 --- a/.gitignore +++ b/.gitignore @@ -1,46 +1,12 @@ -# Prerequisites -*.d - -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app - -# Build Folders -build -buildc -dist - -# Coveralls repo token .coveralls.yml - .vscode .vs +build +build-* + doc/html doc/latex +examples __pycache__ - -examples diff --git a/meson.build b/meson.build index 2e30900..3103df0 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,10 @@ -project('inja', 'cpp', default_options: ['cpp_std=c++17']) +project( + 'inja', + 'cpp', + version: '3.3.0', + default_options: ['cpp_std=c++17', 'warning_level=3'], + meson_version: '>=0.56' +) inja_dep = declare_dependency( @@ -6,18 +12,30 @@ inja_dep = declare_dependency( ) -amalg_script = files('scripts/update_single_include.sh') - -amalg_files = files( +install_headers( + 'include/inja/config.hpp', + 'include/inja/environment.hpp', + 'include/inja/exceptions.hpp', + 'include/inja/function_storage.hpp', 'include/inja/inja.hpp', - 'include/inja/renderer.hpp', - 'include/inja/environment.hpp', + 'include/inja/lexer.hpp', + 'include/inja/node.hpp', + 'include/inja/parser.hpp', + 'include/inja/renderer.hpp', + 'include/inja/statistics.hpp', + 'include/inja/template.hpp', + 'include/inja/token.hpp', + 'include/inja/utils.hpp', + subdir: 'inja' ) -amalg_tgt = run_target( 'amalg', - command: amalg_script + +run_command( + find_program('scripts/update_single_include.sh'), + check: true ) + if get_option('build_tests') inja_test = executable( 'inja_test', diff --git a/test/test-functions.cpp b/test/test-functions.cpp index cdcc5ba..6f1c0a9 100644 --- a/test/test-functions.cpp +++ b/test/test-functions.cpp @@ -265,7 +265,7 @@ TEST_CASE("callbacks") { CHECK(env.render("{{ double-greetings() }}", data) == "Hello Hello!"); CHECK(env.render("{{ multiply(4, 5) }}", data) == "20.0"); CHECK(env.render("{{ multiply(4, 2 + 3) }}", data) == "20.0"); - CHECK(env.render("{{ multiply(2 + 2, 5) }}", data) == "20.0"); + CHECK(env.render("{{ multiply(2 + 2, 6) }}", data) == "24.0"); CHECK(env.render("{{ multiply(length(\"tester\"), 5) }}", data) == "30.0"); CHECK(env.render("{{ multiply(5, length(\"t\")) }}", data) == "5.0"); CHECK(env.render("{{ multiply(3, 4, 5) }}", data) == "60.0");