-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Remove circular dependencies in headers (#295)
* Remove circular dependencies in headers * Fix unit test includes and test data directory location
- Loading branch information
Showing
17 changed files
with
97 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ doc/latex | |
examples | ||
|
||
__pycache__ | ||
/CMakeLists.txt.user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
#include <utility> | ||
#include <vector> | ||
|
||
#include "inja.hpp" | ||
#include "json.hpp" | ||
|
||
namespace inja { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef INCLUDE_INJA_JSON_HPP_ | ||
#define INCLUDE_INJA_JSON_HPP_ | ||
|
||
#include <nlohmann/json.hpp> | ||
|
||
namespace inja { | ||
#ifndef INJA_DATA_TYPE | ||
using json = nlohmann::json; | ||
#else | ||
using json = INJA_DATA_TYPE; | ||
#endif | ||
} // namespace inja | ||
|
||
#endif // INCLUDE_INJA_JSON_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef INCLUDE_INJA_THROW_HPP_ | ||
#define INCLUDE_INJA_THROW_HPP_ | ||
|
||
#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(INJA_NOEXCEPTION) | ||
#ifndef INJA_THROW | ||
#define INJA_THROW(exception) throw exception | ||
#endif | ||
#else | ||
#include <cstdlib> | ||
#ifndef INJA_THROW | ||
#define INJA_THROW(exception) \ | ||
std::abort(); \ | ||
std::ignore = exception | ||
#endif | ||
#ifndef INJA_NOEXCEPTION | ||
#define INJA_NOEXCEPTION | ||
#endif | ||
#endif | ||
|
||
#endif // INCLUDE_INJA_THROW_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef INCLUDE_TEST_COMMON_HPP_ | ||
#define INCLUDE_TEST_COMMON_HPP_ | ||
|
||
#include <string> | ||
#include <doctest/doctest.h> | ||
|
||
extern const std::string test_file_directory; | ||
|
||
#endif // INCLUDE_TEST_COMMON_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
// Copyright (c) 2020 Pantor. All rights reserved. | ||
|
||
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN | ||
|
||
#include <doctest/doctest.h> | ||
|
||
#define JSON_USE_IMPLICIT_CONVERSIONS 0 | ||
#define JSON_NO_IO 1 | ||
#include "inja/inja.hpp" | ||
|
||
const std::string test_file_directory {"../test/data/"}; | ||
|
||
#include "test-files.cpp" | ||
#include "test-functions.cpp" | ||
#include "test-renderer.cpp" | ||
#include "test-units.cpp" | ||
|
||
#define xstr(s) str(s) | ||
#define str(s) #s | ||
|
||
const std::string test_file_directory { xstr(__TEST_DIR__)"/data/" }; |