| 81 | namespace mdf::test { |
| 82 | |
| 83 | void TestRead::SetUpTestSuite() { |
| 84 | // Set up the log file to log to console |
| 85 | util::log::LogConfig &log_config = util::log::LogConfig::Instance(); |
| 86 | log_config.Type(util::log::LogType::LogToConsole); |
| 87 | log_config.CreateDefaultLogger(); |
| 88 | |
| 89 | MdfLogStream::SetLogFunction1(MdfLogFunction); |
| 90 | |
| 91 | kMdfList.clear(); |
| 92 | try { |
| 93 | for (const auto &entry : recursive_directory_iterator(mdf_source_dir)) { |
| 94 | if (!entry.is_regular_file()) { |
| 95 | continue; |
| 96 | } |
| 97 | const auto &fullname = entry.path(); |
| 98 | const auto stem = fullname.stem().string(); |
| 99 | if (kMdfList.find(stem) == kMdfList.cend() && IsMdfFile(fullname.string())) { |
| 100 | std::cout << "Found MDF file. File: " << stem << std::endl; |
| 101 | kMdfList.emplace(stem, fullname.string()); |
| 102 | } |
| 103 | } |
| 104 | } catch (const std::exception &error) { |
| 105 | std::cout << "Failed to fetch the MDF test files. Error: " |
| 106 | << error.what() << std::endl; |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | void TestRead::TearDownTestSuite() { |
| 111 | MdfLogStream::SetLogFunction1(nullptr); |