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

Function TEST

CppCoverageTest/CppCliTest.cpp:31–51  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

29{
30 //---------------------------------------------------------------------
31 TEST(CppCliTest, ManagedUnManagedModule)
32 {
33 auto vsPath = TestHelper::GetVisualStudioPath();
34 fs::path vsConsoleTestPath = vsPath / "Common7" / "IDE" /
35 "CommonExtensions" / "Microsoft" /
36 "TestWindow" / "vstest.console.exe";
37 auto testCppCliPath = (fs::path{OUT_DIR} / "DefaultTest.dll").wstring();
38 auto sharedLibModulePath = TestCoverageSharedLib::GetOutputBinaryPath();
39
40 TestTools::CoverageArgs coverageArgs(
41 {testCppCliPath}, testCppCliPath, L"None");
42 coverageArgs.modulePatternCollection_.push_back(
43 sharedLibModulePath.wstring());
44 coverageArgs.programToRun_ = vsConsoleTestPath;
45
46 auto coverage = TestTools::ComputeCoverageDataPatterns(coverageArgs);
47 ASSERT_EQ(0, coverage.GetExitCode());
48 const auto& modules = coverage.GetModules();
49 ASSERT_EQ(1, modules.size());
50 ASSERT_EQ(sharedLibModulePath, modules.at(0)->GetPath());
51 }
52}

Callers

nothing calls this directly

Calls 4

GetVisualStudioPathFunction · 0.85
GetExitCodeMethod · 0.80
GetOutputBinaryPathFunction · 0.50

Tested by

no test coverage detected