MCPcopy Create free account
hub / github.com/KDE/kdevelop / testJob

Method testJob

plugins/cppcheck/tests/test_cppcheckjob.cpp:44–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44void TestCppcheckJob::testJob()
45{
46 QStringList stdoutOutput = {
47 "Checking source1.cpp...",
48 "1/2 files checked 50% done",
49 "Checking source2.cpp...",
50 "2/2 files checked 50% done"
51 };
52
53 QStringList stderrOutput = {
54 "(information) Couldn't find path given by -I '/missing_include_dir_1/'",
55 "(information) Couldn't find path given by -I '/missing_include_dir_2/'",
56 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
57 "<results version=\"2\">",
58 " <cppcheck version=\"1.72\"/>",
59 " <errors>",
60 " <error id=\"missingInclude\" severity=\"information\" msg=\"msg...\" verbose=\"verbose...\"/>",
61 " </errors>",
62 "</results>"
63 };
64
65 Parameters jobParams;
66 JobTester jobTester(jobParams);
67
68 jobTester.postProcessStderr(stderrOutput);
69 jobTester.postProcessStdout(stdoutOutput);
70
71 // move non-XML elements from stderrOutput
72 stdoutOutput.push_front(stderrOutput[1]);
73 stdoutOutput.push_front(stderrOutput[0]);
74 stderrOutput.pop_front();
75 stderrOutput.pop_front();
76
77 QCOMPARE(jobTester.standardOutput(), stdoutOutput.join('\n'));
78 QCOMPARE(jobTester.xmlOutput(), stderrOutput.join('\n'));
79}
80
81QTEST_GUILESS_MAIN(TestCppcheckJob)
82

Callers

nothing calls this directly

Calls 5

joinMethod · 0.80
xmlOutputMethod · 0.80
postProcessStderrMethod · 0.45
postProcessStdoutMethod · 0.45
standardOutputMethod · 0.45

Tested by

no test coverage detected