MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / TEST_F

Function TEST_F

ExporterTest/HtmlExporterTest.cpp:78–102  ·  view source on GitHub ↗

-------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

76
77 //-------------------------------------------------------------------------
78 TEST_F(HtmlExporterTest, Export)
79 {
80 fs::path testFolder = fs::path(PROJECT_DIR) / "Data";
81 Plugin::CoverageData data{ L"Test", 0};
82 std::wstring filename1{ L"TestFile1.cpp"};
83 std::wstring filename2{ L"TestFile2.cpp"};
84
85 auto& module1 = data.AddModule(L"Module1.exe");
86 auto& file1 = module1.AddFile(testFolder / filename1);
87 auto& file2 = module1.AddFile(testFolder / filename2);
88
89 file1.AddLine(0, true);
90 file2.AddLine(0, true);
91
92 data.AddModule(L"Module2.exe");
93
94 htmlExporter_.Export(data, output_);
95
96 auto modulesPath = output_.GetPath() / Exporter::HtmlFolderStructure::FolderModules;
97 ASSERT_TRUE(Tools::FileExists(output_.GetPath() / "index.html"));
98 ASSERT_TRUE(Tools::FileExists(modulesPath / "module1.html"));
99 ASSERT_FALSE(Tools::FileExists(modulesPath / "module2.html"));
100 ASSERT_TRUE(Tools::FileExists(modulesPath / "module1" / (filename1 + L".html")));
101 ASSERT_TRUE(Tools::FileExists(modulesPath / "module1" / (filename2 + L".html")));
102 }
103
104 //-------------------------------------------------------------------------
105 TEST_F(HtmlExporterTest, NoWarning)

Callers

nothing calls this directly

Calls 6

FileExistsFunction · 0.85
ASSERT_NO_THROWFunction · 0.85
AddModuleMethod · 0.80
AddFileMethod · 0.80
AddLineMethod · 0.80
ExportMethod · 0.45

Tested by

no test coverage detected