UnitTest: Cleanup

Improve naming and introduce googletest.h.

Change-Id: I445c13db4c23d6dd5682ce0db3b83055cc6b8a89
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2016-09-15 17:41:41 +02:00
parent f717064a91
commit 47c01daeb2
67 changed files with 227 additions and 348 deletions

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <clangactivationsequencecontextprocessor.h>
#include <clangcodemodel/clangcompletionassistinterface.h>
@@ -32,11 +34,6 @@
#include <QTextCursor>
#include <QTextDocument>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
namespace {
using ContextProcessor = ClangCodeModel::Internal::ActivationSequenceContextProcessor;

View File

@@ -23,15 +23,12 @@
**
****************************************************************************/
#include "googletest.h"
#include <clangactivationsequenceprocessor.h>
#include <cplusplus/Token.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
namespace {
using testing::PrintToString;

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include "chunksreportedmonitor.h"
#include <QSignalSpy>
@@ -43,10 +45,8 @@ bool ChunksReportedMonitor::waitUntilFinished(int timeoutInMs)
return spy.wait(timeoutInMs);
}
void ChunksReportedMonitor::onResultsReadyAt(int beginIndex, int endIndex)
void ChunksReportedMonitor::onResultsReadyAt(int, int)
{
Q_UNUSED(beginIndex)
Q_UNUSED(endIndex)
++m_resultsReadyCounter;
}

View File

@@ -23,8 +23,8 @@
**
****************************************************************************/
#include "clangasyncjobtest.h"
#include "testutils.h"
#include "clangasyncjob-base.h"
#include "processevents-utilities.h"
#include <clangbackendipc/filecontainer.h>
@@ -66,5 +66,5 @@ bool ClangAsyncJobTest::waitUntilJobFinished(const ClangBackEnd::IAsyncJob &asyn
{
const auto isOnFinishedSlotExecuted = [&asyncJob](){ return asyncJob.isFinished(); };
return TestUtils::processEventsUntilTrue(isOnFinishedSlotExecuted, timeOutInMs);
return ProcessEventUtilities::processEventsUntilTrue(isOnFinishedSlotExecuted, timeOutInMs);
}

View File

@@ -25,21 +25,18 @@
#pragma once
#include "googletest.h"
#include "dummyclangipcclient.h"
#include "mockclangcodemodelclient.h"
#include "clangiasyncjob.h"
#include <clangdocument.h>
#include <clangiasyncjob.h>
#include <clangjobrequest.h>
#include <projects.h>
#include <clangdocuments.h>
#include <unsavedfiles.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
class ClangAsyncJobTest : public ::testing::Test
{
protected:

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <clangcodecompleteresults.h>
#include <clangdocument.h>
#include <clangfilepath.h>
@@ -36,11 +38,6 @@
#include <clang-c/Index.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
namespace {
using ClangBackEnd::ClangCodeCompleteResults;

View File

@@ -23,7 +23,7 @@
**
****************************************************************************/
#include "clangasyncjobtest.h"
#include "clangasyncjob-base.h"
#include <clangcompletecodejob.h>

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <clangcodemodel/clangcompletioncontextanalyzer.h>
#include <clangcodemodel/clangcompletionassistinterface.h>
@@ -30,11 +32,6 @@
#include <QTextDocument>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
namespace ClangCodeModel {
namespace Internal {

View File

@@ -23,7 +23,7 @@
**
****************************************************************************/
#include "clangasyncjobtest.h"
#include "clangasyncjob-base.h"
#include <clangcreateinitialdocumentpreamblejob.h>

View File

@@ -23,15 +23,12 @@
**
****************************************************************************/
#include "googletest.h"
#include <clangdiagnosticfilter.h>
#include <diagnosticcontainer.h>
#include <fixitcontainer.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
namespace {
using ::testing::Contains;

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <clangfilepath.h>
#include <clangtranslationunitupdater.h>
#include <commandlinearguments.h>
@@ -41,11 +43,6 @@
#include <clang-c/Index.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
#include <QTemporaryFile>
#include <chrono>

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <projectpart.h>
#include <clangexceptions.h>
#include <projects.h>
@@ -33,11 +35,6 @@
#include <clang-c/Index.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using ClangBackEnd::Document;
using ClangBackEnd::UnsavedFiles;
using ClangBackEnd::ProjectPart;

View File

@@ -23,10 +23,7 @@
**
****************************************************************************/
#include "gtest/gtest.h"
#include "gmock/gmock-matchers.h"
#include "gmock/gmock.h"
#include "gtest-qt-printing.h"
#include "googletest.h"
#include <clangfixitoperation.h>
#include <fixitcontainer.h>

View File

@@ -23,8 +23,10 @@
**
****************************************************************************/
#include "googletest.h"
#include "mockclangcodemodelclient.h"
#include "testutils.h"
#include "processevents-utilities.h"
#include <clangcodemodelserver.h>
#include <highlightingmarkcontainer.h>
@@ -41,11 +43,6 @@
#include <QFile>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using testing::Property;
using testing::Contains;
using testing::Not;
@@ -331,7 +328,7 @@ bool ClangClangCodeModelServer::waitUntilAllJobsFinished(int timeOutInMs)
&& !clangServer.isTimerRunningForTestOnly();
};
return TestUtils::processEventsUntilTrue(noJobsRunningAnymore, timeOutInMs);
return ProcessEventUtilities::processEventsUntilTrue(noJobsRunningAnymore, timeOutInMs);
}
void ClangClangCodeModelServer::registerProjectAndFilesAndWaitForFinished(

View File

@@ -23,14 +23,11 @@
**
****************************************************************************/
#include "googletest.h"
#include <clangisdiagnosticrelatedtolocation.h>
#include <diagnosticcontainer.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using ClangBackEnd::DiagnosticContainer;
using ClangBackEnd::SourceLocationContainer;
using ClangBackEnd::SourceRangeContainer;

View File

@@ -23,7 +23,8 @@
**
****************************************************************************/
#include "testutils.h"
#include "googletest.h"
#include "processevents-utilities.h"
#include <clangdocument.h>
#include <clangdocuments.h>
@@ -35,11 +36,6 @@
#include <clang-c/Index.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
#include <QTemporaryFile>
using namespace ClangBackEnd;

View File

@@ -23,7 +23,8 @@
**
****************************************************************************/
#include "testutils.h"
#include "googletest.h"
#include "processevents-utilities.h"
#include "dummyclangipcclient.h"
#include <clangdocument.h>
@@ -36,11 +37,6 @@
#include <clang-c/Index.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using namespace ClangBackEnd;
using testing::IsNull;
@@ -136,7 +132,7 @@ bool Jobs::waitUntilAllJobsFinished(int timeOutInMs) const
{
const auto noJobsRunningAnymore = [this](){ return jobs.runningJobs() == 0; };
return TestUtils::processEventsUntilTrue(noJobsRunningAnymore, timeOutInMs);
return ProcessEventUtilities::processEventsUntilTrue(noJobsRunningAnymore, timeOutInMs);
}
bool Jobs::waitUntilJobChainFinished(int timeOutInMs) const
@@ -145,7 +141,7 @@ bool Jobs::waitUntilJobChainFinished(int timeOutInMs) const
return jobs.runningJobs() == 0 && jobs.queue().isEmpty();
};
return TestUtils::processEventsUntilTrue(noJobsRunningAnymore, timeOutInMs);
return ProcessEventUtilities::processEventsUntilTrue(noJobsRunningAnymore, timeOutInMs);
}
JobRequest Jobs::createJobRequest(const Utf8String &filePath,

View File

@@ -23,7 +23,7 @@
**
****************************************************************************/
#include "clangasyncjobtest.h"
#include "clangasyncjob-base.h"
#include <clangrequestdocumentannotationsjob.h>

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <clangstring.h>
#include <utf8string.h>
@@ -30,11 +32,6 @@
#include <clang-c/CXString.h>
#include <clang-c/Index.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
namespace {
using ::testing::StrEq;

View File

@@ -23,7 +23,7 @@
**
****************************************************************************/
#include "clangasyncjobtest.h"
#include "clangasyncjob-base.h"
#include <clangupdatedocumentannotationsjob.h>

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include "mockclangcodemodelclient.h"
#include "mockclangcodemodelserver.h"
@@ -55,11 +57,6 @@
#include <vector>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using namespace ClangBackEnd;
namespace {

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include "mockclangcodemodelclient.h"
#include <cmbalivemessage.h>
@@ -41,11 +43,6 @@
#include <translationunitdoesnotexistmessage.h>
#include <writemessageblock.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
#include <utils/hostosinfo.h>
#include <QBuffer>

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <codecompleter.h>
#include <clangdocument.h>
#include <filecontainer.h>
@@ -36,11 +38,6 @@
#include <QFile>
#include <QTemporaryDir>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using ::testing::ElementsAreArray;
using ::testing::Contains;
using ::testing::AllOf;

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <clangcodecompleteresults.h>
#include <clangdocument.h>
#include <clangfilepath.h>
@@ -40,11 +42,6 @@
#include <QFile>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using ClangBackEnd::CodeCompletionsExtractor;
using ClangBackEnd::ClangCodeCompleteResults;
using ClangBackEnd::FilePath;

View File

@@ -23,14 +23,11 @@
**
****************************************************************************/
#include "googletest.h"
#include <codecompletionchunk.h>
#include <clangcompletionchunkstotextconverter.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
namespace {
using ClangBackEnd::CodeCompletionChunk;

View File

@@ -23,9 +23,7 @@
**
****************************************************************************/
#include "gtest/gtest.h"
#include "gmock/gmock-matchers.h"
#include "gtest-qt-printing.h"
#include "googletest.h"
#include <QString>

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <clangdocument.h>
#include <clangdocuments.h>
#include <clangstring.h>
@@ -34,11 +36,6 @@
#include <clangtranslationunit.h>
#include <unsavedfiles.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using ClangBackEnd::Cursor;
using ClangBackEnd::Document;
using ClangBackEnd::TranslationUnit;

View File

@@ -23,6 +23,9 @@
**
****************************************************************************/
#include "googletest.h"
#include "diagnosticcontainer-matcher.h"
#include <diagnostic.h>
#include <diagnosticcontainer.h>
#include <diagnosticset.h>
@@ -38,12 +41,6 @@
#include <clang-c/Index.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
#include "matcher-diagnosticcontainer.h"
using ::testing::Contains;
using ::testing::Not;

View File

@@ -23,6 +23,9 @@
**
****************************************************************************/
#include "googletest.h"
#include "diagnosticcontainer-matcher.h"
#include <clangbackendipc_global.h>
#include <clangdocument.h>
#include <diagnosticcontainer.h>
@@ -39,12 +42,6 @@
#include <clang-c/Index.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "matcher-diagnosticcontainer.h"
#include "gtest-qt-printing.h"
using ::testing::Contains;
using ::testing::Not;
using ::testing::PrintToString;

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <diagnostic.h>
#include <diagnosticset.h>
#include <projectpart.h>
@@ -37,11 +39,6 @@
#include <clang-c/Index.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using ClangBackEnd::DiagnosticSet;
using ClangBackEnd::Document;
using ClangBackEnd::TranslationUnit;

View File

@@ -0,0 +1,31 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <clangdocument.h>
#include <clangdocuments.h>
#include <clangtranslationunit.h>
@@ -39,11 +41,6 @@
#include <clang-c/Index.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using ClangBackEnd::Cursor;
using ClangBackEnd::HighlightingTypes;
using ClangBackEnd::HighlightingMark;

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <chunksreportedmonitor.h>
#include <clangdocument.h>
#include <clangdocuments.h>
@@ -34,11 +36,6 @@
#include <projects.h>
#include <unsavedfiles.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using ClangBackEnd::Cursor;
using ClangBackEnd::HighlightingMarks;
using ClangBackEnd::HighlightingMarkContainer;

View File

@@ -23,13 +23,11 @@
**
****************************************************************************/
#include "googletest.h"
#include <lineprefixer.h>
#include <utf8string.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
namespace {
QByteArray runPrefixer(QList<QByteArray> inputChunks);

View File

@@ -32,7 +32,7 @@
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
class RefactoringClientCallBackMock
class MockRefactoringClientCallBack
{
public:
MOCK_METHOD3(localRenaming,

View File

@@ -23,7 +23,7 @@
**
****************************************************************************/
#include "testutils.h"
#include "processevents-utilities.h"
#include <QCoreApplication>
#include <QThread>
@@ -31,7 +31,9 @@
#include <QDebug>
bool TestUtils::processEventsUntilTrue(std::function<bool ()> condition, int timeOutInMs)
namespace ProcessEventUtilities
{
bool processEventsUntilTrue(std::function<bool ()> condition, int timeOutInMs)
{
if (condition())
return true;
@@ -52,3 +54,4 @@ bool TestUtils::processEventsUntilTrue(std::function<bool ()> condition, int tim
QCoreApplication::processEvents();
}
}
}

View File

@@ -27,8 +27,7 @@
#include <functional>
class TestUtils
namespace ProcessEventUtilities
{
public:
static bool processEventsUntilTrue(std::function<bool ()> condition, int timeOutInMs);
};
bool processEventsUntilTrue(std::function<bool ()> condition, int timeOutInMs);
}

View File

@@ -23,16 +23,13 @@
**
****************************************************************************/
#include "googletest.h"
#include <projectpart.h>
#include <clangexceptions.h>
#include <projects.h>
#include <utf8stringvector.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
#include <chrono>
#include <thread>

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <cmbalivemessage.h>
#include <cmbcodecompletedmessage.h>
#include <cmbcompletecodemessage.h>
@@ -46,11 +48,6 @@
#include <vector>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using namespace testing;
namespace CodeModelBackeEndTest {

View File

@@ -23,7 +23,8 @@
**
****************************************************************************/
#include "refactoringclientcallbackmock.h"
#include "googletest.h"
#include "mockrefactoringclientcallback.h"
#include <refactoringclient.h>
#include <refactoringcompileroptionsbuilder.h>
@@ -39,11 +40,6 @@
#include <QTextCursor>
#include <QTextDocument>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
namespace {
using ClangRefactoring::RefactoringCompilerOptionsBuilder;
@@ -59,7 +55,7 @@ class RefactoringClient : public ::testing::Test
void SetUp();
protected:
RefactoringClientCallBackMock callbackMock;
MockRefactoringClientCallBack callbackMock;
ClangRefactoring::RefactoringClient client;
ClangBackEnd::RefactoringConnectionClient connectionClient{&client};
RefactoringEngine engine{connectionClient.serverProxy(), client};

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include "mockrefactoringclient.h"
#include "mockrefactoringserver.h"
@@ -38,11 +40,6 @@
#include <vector>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using namespace ClangBackEnd;
namespace {

View File

@@ -23,12 +23,9 @@
**
****************************************************************************/
#include <refactoringcompilationdatabase.h>
#include "googletest.h"
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
#include <refactoringcompilationdatabase.h>
using testing::Contains;
using testing::IsEmpty;

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include "mockrefactoringserver.h"
#include "mockrefactoringclient.h"
@@ -37,11 +39,6 @@
#include <QTextCursor>
#include <QTextDocument>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
namespace {
using testing::_;

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include "mockrefactoringclient.h"
#include <refactoringserver.h>
@@ -30,11 +32,6 @@
#include <sourcelocationsforrenamingmessage.h>
#include <sourcelocationscontainer.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
namespace {
using testing::AllOf;

View File

@@ -23,12 +23,9 @@
**
****************************************************************************/
#include <cpptools/senddocumenttracker.h>
#include "googletest.h"
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
#include <cpptools/senddocumenttracker.h>
using CppTools::SendDocumentTracker;
using testing::PrintToString;

View File

@@ -23,9 +23,7 @@
**
****************************************************************************/
#include "gtest/gtest.h"
#include "gmock/gmock-matchers.h"
#include "gtest-qt-printing.h"
#include "googletest.h"
#include <utils/sizedarray.h>

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <cursor.h>
#include <clangdocument.h>
#include <clangdocuments.h>
@@ -39,11 +41,6 @@
#include <QVector>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using ClangBackEnd::Cursor;
using ClangBackEnd::Document;
using ClangBackEnd::Documents;

View File

@@ -23,9 +23,7 @@
**
****************************************************************************/
#include "gtest/gtest.h"
#include "gmock/gmock-matchers.h"
#include "gtest-qt-printing.h"
#include "googletest.h"
#include <QString>

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <diagnostic.h>
#include <diagnosticset.h>
#include <projectpart.h>
@@ -35,11 +37,6 @@
#include <clang-c/Index.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using ClangBackEnd::Diagnostic;
using ClangBackEnd::DiagnosticSet;
using ClangBackEnd::ProjectPart;

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <clangtranslationunit.h>
#include <diagnostic.h>
#include <diagnosticset.h>
@@ -37,11 +39,6 @@
#include <memory>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using ClangBackEnd::DiagnosticSet;
using ClangBackEnd::Document;
using ClangBackEnd::Documents;

View File

@@ -23,12 +23,9 @@
**
****************************************************************************/
#include <sqlitecolumn.h>
#include "googletest.h"
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
#include <sqlitecolumn.h>
namespace {

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include "spydummy.h"
#include <sqlitedatabase.h>
@@ -32,11 +34,6 @@
#include <QSignalSpy>
#include <QVariant>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
namespace {
class SqliteDatabase : public ::testing::Test

View File

@@ -23,17 +23,14 @@
**
****************************************************************************/
#include "sqlitedatabasebackend.h"
#include "sqliteexception.h"
#include "sqlitewritestatement.h"
#include "googletest.h"
#include <sqlitedatabasebackend.h>
#include <sqliteexception.h>
#include <sqlitewritestatement.h>
#include <QDir>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
namespace {
class SqliteDatabaseBackend : public ::testing::Test

View File

@@ -23,6 +23,8 @@
**
****************************************************************************/
#include "googletest.h"
#include <sqlitedatabasebackend.h>
#include <sqlitereadstatement.h>
#include <sqlitereadwritestatement.h>
@@ -36,11 +38,6 @@
#include <QStringList>
#include <QVariant>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
namespace {
class SqliteStatement : public ::testing::Test
{

View File

@@ -23,6 +23,7 @@
**
****************************************************************************/
#include "googletest.h"
#include "spydummy.h"
#include <sqlitecolumn.h>
@@ -33,11 +34,6 @@
#include <QSignalSpy>
#include <QVariant>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
namespace {
class SqliteTable : public ::testing::Test

View File

@@ -23,17 +23,14 @@
**
****************************************************************************/
#include "googletest.h"
#include <sqlstatementbuilderexception.h>
#include <sqlstatementbuilder.h>
#include <utf8stringvector.h>
#include <QString>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using namespace ::testing;
TEST(SqlStatementBuilder, Bind)

View File

@@ -23,15 +23,12 @@
**
****************************************************************************/
#include "googletest.h"
#include <clangrefactoringbackend_global.h>
#include <symbolfinder.h>
#include "filesystemutilities.h"
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
#include "filesystem-utilities.h"
using ClangBackEnd::SymbolFinder;
using ClangBackEnd::FileContent;

View File

@@ -23,15 +23,12 @@
**
****************************************************************************/
#include "googletest.h"
#include <clangtranslationunitupdater.h>
#include <clang-c/Index.h>
#include <gmock/gmock.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include "gtest-qt-printing.h"
using ClangBackEnd::TranslationUnitUpdater;
using ClangBackEnd::TranslationUnitUpdateInput;
using ClangBackEnd::TranslationUnitUpdateResult;

View File

@@ -25,101 +25,102 @@ win32:DEFINES += ECHOSERVER=\"R\\\"xxx($$OUT_PWD/../echo)xxx\\\"\"
unix: DEFINES += ECHOSERVER=\"R\\\"xxx($$OUT_PWD/../echoserver/echo)xxx\\\"\"
SOURCES += \
clientserverinprocesstest.cpp \
clientserverinprocess-test.cpp \
clientserveroutsideprocess.cpp \
lineprefixertest.cpp \
main.cpp \
readandwritemessageblocktest.cpp \
sizedarraytest.cpp \
lineprefixer-test.cpp \
processevents-utilities.cpp \
readandwritemessageblock-test.cpp \
sizedarray-test.cpp \
smallstring-test.cpp \
spydummy.cpp \
smallstringtest.cpp \
testutils.cpp \
utf8test.cpp
unittests-main.cpp \
utf8-test.cpp
!isEmpty(LIBCLANG_LIBS) {
SOURCES += \
activationsequencecontextprocessortest.cpp \
activationsequenceprocessortest.cpp \
clangcodecompleteresultstest.cpp \
clangcompletioncontextanalyzertest.cpp \
clangdiagnosticfiltertest.cpp \
clangfixitoperationtest.cpp \
clangipcservertest.cpp \
clangstringtest.cpp \
codecompletionsextractortest.cpp \
codecompletiontest.cpp \
completionchunkstotextconvertertest.cpp \
createtablesqlstatementbuildertest.cpp \
diagnosticsettest.cpp \
diagnostictest.cpp \
fixittest.cpp \
projecttest.cpp \
sourcelocationtest.cpp \
sourcerangetest.cpp \
sqlitecolumntest.cpp \
sqlitedatabasebackendtest.cpp \
sqlitedatabasetest.cpp \
sqlitestatementtest.cpp \
sqlitetabletest.cpp \
sqlstatementbuildertest.cpp \
clangdocumenttest.cpp \
clangdocumentstest.cpp \
unsavedfilestest.cpp \
senddocumenttrackertest.cpp \
cursortest.cpp \
skippedsourcerangestest.cpp \
highlightingmarksreportertest.cpp \
activationsequencecontextprocessor-test.cpp \
activationsequenceprocessor-test.cpp \
chunksreportedmonitor.cpp \
unsavedfiletest.cpp \
clangisdiagnosticrelatedtolocationtest.cpp \
highlightingmarkstest.cpp \
utf8positionfromlinecolumntest.cpp \
translationunitupdatertest.cpp \
clangasyncjobtest.cpp \
clangcompletecodejobtest.cpp \
clangcreateinitialdocumentpreamblejobtest.cpp \
clangjobqueuetest.cpp \
clangjobstest.cpp \
clangrequestdocumentannotationsjobtest.cpp \
clangupdatedocumentannotationsjobtest.cpp
clangasyncjob-base.cpp \
clangcodecompleteresults-test.cpp \
clangcompletecodejob-test.cpp \
clangcompletioncontextanalyzer-test.cpp \
clangcreateinitialdocumentpreamblejob-test.cpp \
clangdiagnosticfilter-test.cpp \
clangdocuments-test.cpp \
clangdocument-test.cpp \
clangfixitoperation-test.cpp \
clangipcserver-test.cpp \
clangisdiagnosticrelatedtolocation-test.cpp \
clangjobqueue-test.cpp \
clangjobs-test.cpp \
clangrequestdocumentannotationsjob-test.cpp \
clangstring-test.cpp \
clangupdatedocumentannotationsjob-test.cpp \
codecompletionsextractor-test.cpp \
codecompletion-test.cpp \
completionchunkstotextconverter-test.cpp \
createtablesqlstatementbuilder-test.cpp \
cursor-test.cpp \
diagnosticset-test.cpp \
diagnostic-test.cpp \
fixit-test.cpp \
highlightingmarksreporter-test.cpp \
highlightingmarks-test.cpp \
projectpart-test.cpp \
senddocumenttracker-test.cpp \
skippedsourceranges-test.cpp \
sourcelocation-test.cpp \
sourcerange-test.cpp \
sqlitecolumn-test.cpp \
sqlitedatabasebackend-test.cpp \
sqlitedatabase-test.cpp \
sqlitestatement-test.cpp \
sqlitetable-test.cpp \
sqlstatementbuilder-test.cpp \
translationunitupdater-test.cpp \
unsavedfiles-test.cpp \
unsavedfile-test.cpp \
utf8positionfromlinecolumn-test.cpp
}
!isEmpty(LIBTOOLING_LIBS) {
SOURCES += \
refactoringclientserverinprocesstest.cpp \
refactoringcompilationdatabasetest.cpp \
refactoringservertest.cpp \
refactoringenginetest.cpp \
refactoringclienttest.cpp \
symbolfindertest.cpp
refactoringclientserverinprocess-test.cpp \
refactoringclient-test.cpp \
refactoringcompilationdatabase-test.cpp \
refactoringengine-test.cpp \
refactoringserver-test.cpp \
symbolfinder-test.cpp
}
exists($$GOOGLEBENCHMARK_DIR) {
SOURCES += \
smallstringbenchmark.cpp
smallstring-benchmark.cpp
}
HEADERS += \
filesystem-utilities.h \
googletest.h \
gtest-qt-printing.h \
spydummy.h \
dummyclangipcclient.h \
testutils.h \
mockclangcodemodelclient.h \
mockclangcodemodelserver.h \
mockrefactoringclient.h \
mockrefactoringserver.h \
refactoringclientcallbackmock.h
processevents-utilities.h \
spydummy.h
!isEmpty(LIBCLANG_LIBS) {
HEADERS += \
clangasyncjobtest.h \
chunksreportedmonitor.h \
matcher-diagnosticcontainer.h
clangasyncjob-base.h \
diagnosticcontainer-matcher.h \
dummyclangipcclient.h \
mockclangcodemodelclient.h \
mockclangcodemodelserver.h
}
!isEmpty(LIBTOOLING_LIBS) {
HEADERS += \
filesystemutilities.h
mockrefactoringclientcallback.h \
mockrefactoringclient.h \
mockrefactoringserver.h
}
OTHER_FILES += $$files(data/*)

View File

@@ -23,10 +23,7 @@
**
****************************************************************************/
#include "gtest/gtest.h"
#include "gmock/gmock-matchers.h"
#include "gmock/gmock.h"
#include "gtest-qt-printing.h"
#include "googletest.h"
#include <clangfilepath.h>
#include <unsavedfile.h>

View File

@@ -23,10 +23,7 @@
**
****************************************************************************/
#include "gtest/gtest.h"
#include "gmock/gmock-matchers.h"
#include "gmock/gmock.h"
#include "gtest-qt-printing.h"
#include "googletest.h"
#include <filecontainer.h>
#include <unsavedfiles.h>

View File

@@ -23,9 +23,7 @@
**
****************************************************************************/
#include "gtest/gtest.h"
#include "gmock/gmock-matchers.h"
#include "gtest-qt-printing.h"
#include "googletest.h"
#include <QString>

View File

@@ -23,10 +23,7 @@
**
****************************************************************************/
#include "gtest/gtest.h"
#include "gmock/gmock-matchers.h"
#include "gmock/gmock.h"
#include "gtest-qt-printing.h"
#include "googletest.h"
#include <utf8positionfromlinecolumn.h>
#include <utf8string.h>