Add unit tests.

These test the complete workflow as the user experiences it when
clicking "Start".
Intended usage:
    (1) Run sdktool to set up a kit with the toolchain you want
        to test against (using a temporary directory).
        The tests assume exactly one Kit to be present.
    (2) Start Creator with a matching settings path and
        "-load ClangStaticAnalyzer -test ClangStaticAnalyzer".
    (3) Repeat until all toolchains have been tested.
The initial implementation tests one trivial source file
with both qbs and qmake.

Change-Id: I810f23e2990a789a4dd9f1dd16335fbcf5c5f39f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Christian Kandeler
2015-02-04 15:19:30 +01:00
parent c632be5c92
commit 2946364ce6
13 changed files with 227 additions and 0 deletions

View File

@@ -22,6 +22,10 @@
#include "clangstaticanalyzerruncontrolfactory.h"
#include "clangstaticanalyzertool.h"
#ifdef WITH_TESTS
#include "clangstaticanalyzerunittests.h"
#endif
#include <analyzerbase/analyzermanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/icontext.h>
@@ -156,5 +160,14 @@ ExtensionSystem::IPlugin::ShutdownFlag ClangStaticAnalyzerPlugin::aboutToShutdow
return SynchronousShutdown;
}
QList<QObject *> ClangStaticAnalyzerPlugin::createTestObjects() const
{
QList<QObject *> tests;
#ifdef WITH_TESTS
tests << new ClangStaticAnalyzerUnitTests(m_analyzerTool);
#endif
return tests;
}
} // namespace Internal
} // namespace ClangStaticAnalyzerPlugin