MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / SetUpTestSuite

Method SetUpTestSuite

lib/mdflib/mdflib_test/src/testread.cpp:83–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81namespace mdf::test {
82
83void 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
110void TestRead::TearDownTestSuite() {
111 MdfLogStream::SetLogFunction1(nullptr);

Callers

nothing calls this directly

Calls 7

IsMdfFileFunction · 0.85
CreateDefaultLoggerMethod · 0.80
findMethod · 0.80
cendMethod · 0.80
TypeMethod · 0.45
clearMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected