ClangStaticAnalyzer: Move closer to new target/tool split

The ClangStaticAnalyzer is a tool.

Change-Id: I1462997a99e49486b47accb302d3f5b7b0b672b6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
hjk
2017-05-08 09:21:48 +02:00
parent 5b720923c2
commit 314f77fae4
12 changed files with 144 additions and 217 deletions

View File

@@ -48,14 +48,6 @@ using namespace Utils;
namespace ClangStaticAnalyzer {
namespace Internal {
ClangStaticAnalyzerUnitTests::ClangStaticAnalyzerUnitTests(ClangStaticAnalyzerTool *analyzerTool,
QObject *parent)
: QObject(parent)
, m_analyzerTool(analyzerTool)
, m_tmpDir(0)
{
}
void ClangStaticAnalyzerUnitTests::initTestCase()
{
const QList<Kit *> allKits = KitManager::kits();
@@ -87,12 +79,13 @@ void ClangStaticAnalyzerUnitTests::testProject()
CppTools::Tests::ProjectOpenerAndCloser projectManager;
const CppTools::ProjectInfo projectInfo = projectManager.open(projectFilePath, true);
QVERIFY(projectInfo.isValid());
m_analyzerTool->startTool();
QSignalSpy waiter(m_analyzerTool, SIGNAL(finished(bool)));
auto tool = ClangStaticAnalyzerTool::instance();
tool->startTool();
QSignalSpy waiter(tool, SIGNAL(finished(bool)));
QVERIFY(waiter.wait(30000));
const QList<QVariant> arguments = waiter.takeFirst();
QVERIFY(arguments.first().toBool());
QCOMPARE(m_analyzerTool->diagnostics().count(), expectedDiagCount);
QCOMPARE(tool->diagnostics().count(), expectedDiagCount);
}
void ClangStaticAnalyzerUnitTests::testProject_data()