1 #ifndef UTOPIA_CORE_TESTTOOLS_FIXTURES_HH
2 #define UTOPIA_CORE_TESTTOOLS_FIXTURES_HH
8 #include <yaml-cpp/yaml.h>
9 #include <spdlog/spdlog.h>
10 #include <spdlog/sinks/stdout_color_sinks.h>
12 #include "../types.hh"
13 #include "../../data_io/cfg_utils.hh"
26 template<
class RNGType=Utopia::DefaultRNG>
43 std::shared_ptr<spdlog::logger>
log;
46 std::shared_ptr<RNG>
rng;
52 cfg([&config_file_path](){
53 if (config_file_path.size()) {
54 return YAML::LoadFile(config_file_path);
61 auto logger = spdlog::get(
"test");
65 logger = spdlog::stdout_color_mt(
"test");
69 logger->set_level(spdlog::level::trace);
70 spdlog::set_pattern(
"[%T.%e] [%^%l%$] [%n] %v");
77 rng(std::make_shared<RNG>(std::random_device()()))
79 log->info(
"BaseInfrastructure fixture set up.");
80 if (config_file_path.size()) {
81 log->info(
"Test configuration loaded from: {}", config_file_path);
84 log->info(
"No test configuration file loaded.");
YAML::Node Config
Type of a variadic dictionary-like data structure used throughout Utopia.
Definition: types.hh:71