diff options
-rw-r--r-- | test/testHelpers.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/testHelpers.h b/test/testHelpers.h index f2b0901..58e4372 100644 --- a/test/testHelpers.h +++ b/test/testHelpers.h @@ -2,11 +2,22 @@ #include <boost/test/tools/context.hpp> #include <boost/test/tools/interface.hpp> +#include <filesystem> +#include <fstream> #include <iomanip> // IWYU pragma: keep std::setprecision +#include <jsonParse-persistence.h> #include <memory> std::unique_ptr<char, decltype(&free)> uasprintf(const char * fmt, ...) __attribute__((format(printf, 1, 2))); +template<typename T> +decltype(auto) +loadFixtureJson(const std::filesystem::path & path) +{ + std::ifstream in {FIXTURESDIR / path}; + return Persistence::JsonParsePersistence {}.loadState<std::vector<T>>(in); +} + #define BOOST_CHECK_CLOSE_VEC(a_, b_) \ { \ const auto a {a_}, b {b_}; \ |