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

Function TEST

ExporterTest/CoberturaExporterTest.cpp:55–79  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

53
54 //-------------------------------------------------------------------------
55 TEST(CoberturaExporterTest, Export)
56 {
57 Plugin::CoverageData coverageData{L"", 0};
58
59 coverageData.AddModule(L"EmptyModule");
60 auto& module = coverageData.AddModule(L"Module");
61
62 module.AddFile("EmptyFile");
63 auto& file = module.AddFile("File");
64
65 file.AddLine(0, true);
66 file.AddLine(1, false);
67
68 module.AddFile("File2").AddLine(0, true);
69
70 std::wostringstream ostr;
71 Exporter::CoberturaExporter().Export(coverageData, ostr);
72 auto result = ostr.str();
73 std::wregex regex(LR"(timestamp="\d*")");
74 result = std::regex_replace(result, regex, L"timestamp=\"TIMESTAMP\"");
75
76 auto expectedResult = GetExpectedResult();
77
78 ASSERT_EQ(result, expectedResult);
79 }
80
81 //-------------------------------------------------------------------------
82 TEST(CoberturaExporterTest, SubFolderDoesNotExist)

Callers

nothing calls this directly

Calls 8

GetExpectedResultFunction · 0.85
FileExistsFunction · 0.85
LocalToWStringFunction · 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