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

Function TEST

OpenCppCoverageTest/WarningManagerTests.cpp:32–59  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

30{
31 //-------------------------------------------------------------------------
32 TEST(WarningManagerTests, CommandLineTooLong)
33 {
34 std::string stdOut;
35 const std::vector<std::pair<std::string, std::string>>
36 coverageArguments = {
37 {ProgramOptions::SelectedSourcesOption,
38 TestCoverageConsole::GetMainCppPath().string()},
39 {ProgramOptions::SelectedModulesOption,
40 TestCoverageConsole::GetOutputBinaryPath().string()},
41 {ProgramOptions::QuietOption, ""}};
42 std::vector<std::wstring> arguments{TestCoverageConsole::TestBasic};
43
44 RunCoverageFor(coverageArguments,
45 TestCoverageConsole::GetOutputBinaryPath(),
46 arguments,
47 &stdOut);
48 ASSERT_EQ("", stdOut);
49 for (int i = 0; i < OptionsParser::DosCommandLineMaxSize / 10; ++i)
50 arguments.push_back(L"01223456789");
51
52 RunCoverageFor(coverageArguments,
53 TestCoverageConsole::GetOutputBinaryPath(),
54 arguments,
55 &stdOut);
56 auto output = Tools::LocalToWString(stdOut);
57 ASSERT_TRUE(boost::algorithm::contains(
58 output, OptionsParser::GetTooLongCommandLineMessage()));
59 }
60}

Callers

nothing calls this directly

Calls 4

RunCoverageForFunction · 0.85
LocalToWStringFunction · 0.85
GetMainCppPathFunction · 0.50
GetOutputBinaryPathFunction · 0.50

Tested by

no test coverage detected