Commit ada5ea19 authored by Marco Bubke's avatar Marco Bubke

UnitTests: Fix names and disable slow tests by default

Slow and very slow tests have now their own test category. We add SlowTest
for tests which are slower than ~5ms and VerySlowTest if they are slower
than ~100ms. They are disabled them by "-*SlowTest.*". If you have a faster
machine than most developers simply try lower values. The aim is that most
developers can execute the tests in under ~2s.

In the long run we should use dependency breaking and data sharing to
reduce the count of the slow tests.

Change-Id: I8578071258d7f89b2052709f3dd526ced811483f
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent 719e6e0a
......@@ -40,7 +40,7 @@ using ContextProcessor = ClangCodeModel::Internal::ActivationSequenceContextPro
using TextEditor::AssistInterface;
using ClangCodeModel::Internal::ClangCompletionAssistInterface;
TEST(ActivationSequeneContextProcessor, TextCursorPosition)
TEST(ActivationSequenceContextProcessorSlowTest, TextCursorPosition)
{
ClangCompletionAssistInterface interface("foobar", 4);
ContextProcessor processor{&interface};
......@@ -48,7 +48,7 @@ TEST(ActivationSequeneContextProcessor, TextCursorPosition)
ASSERT_THAT(processor.textCursor_forTestOnly().position(), 0);
}
TEST(ActivationSequeneContextProcessor, StringLiteral)
TEST(ActivationSequenceContextProcessor, StringLiteral)
{
ClangCompletionAssistInterface interface("auto foo = \"bar\"", 12);
ContextProcessor processor{&interface};
......@@ -56,7 +56,7 @@ TEST(ActivationSequeneContextProcessor, StringLiteral)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_EOF_SYMBOL);
}
TEST(ActivationSequeneContextProcessor, EndOfStringLiteral)
TEST(ActivationSequenceContextProcessor, EndOfStringLiteral)
{
ClangCompletionAssistInterface interface("auto foo = \"bar\"", 16);
ContextProcessor processor{&interface};
......@@ -64,7 +64,7 @@ TEST(ActivationSequeneContextProcessor, EndOfStringLiteral)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_EOF_SYMBOL);
}
TEST(ActivationSequeneContextProcessor, FunctionCallComma)
TEST(ActivationSequenceContextProcessor, FunctionCallComma)
{
ClangCompletionAssistInterface interface("f(x, ", 4);
ContextProcessor processor{&interface};
......@@ -72,7 +72,7 @@ TEST(ActivationSequeneContextProcessor, FunctionCallComma)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_COMMA);
}
TEST(ActivationSequeneContextProcessor, NonFunctionCallComma)
TEST(ActivationSequenceContextProcessor, NonFunctionCallComma)
{
ClangCompletionAssistInterface interface("int x, ", 6);
ContextProcessor processor{&interface};
......@@ -80,7 +80,7 @@ TEST(ActivationSequeneContextProcessor, NonFunctionCallComma)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_EOF_SYMBOL);
}
TEST(ActivationSequeneContextProcessor, DoxygenComment)
TEST(ActivationSequenceContextProcessor, DoxygenComment)
{
ClangCompletionAssistInterface interface("//! @", 5);
ContextProcessor processor{&interface};
......@@ -88,7 +88,7 @@ TEST(ActivationSequeneContextProcessor, DoxygenComment)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_DOXY_COMMENT);
}
TEST(ActivationSequeneContextProcessor, NonDoxygenComment)
TEST(ActivationSequenceContextProcessor, NonDoxygenComment)
{
ClangCompletionAssistInterface interface("// @", 4);
ContextProcessor processor{&interface};
......@@ -96,7 +96,7 @@ TEST(ActivationSequeneContextProcessor, NonDoxygenComment)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_EOF_SYMBOL);
}
TEST(ActivationSequeneContextProcessor, Comment)
TEST(ActivationSequenceContextProcessor, Comment)
{
ClangCompletionAssistInterface interface("//", 2);
ContextProcessor processor{&interface};
......@@ -104,7 +104,7 @@ TEST(ActivationSequeneContextProcessor, Comment)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_EOF_SYMBOL);
}
TEST(ActivationSequeneContextProcessor, InsideALiteral)
TEST(ActivationSequenceContextProcessor, InsideALiteral)
{
ClangCompletionAssistInterface interface("\"foo\"", 2);
ContextProcessor processor{&interface};
......@@ -112,7 +112,7 @@ TEST(ActivationSequeneContextProcessor, InsideALiteral)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_EOF_SYMBOL);
}
TEST(ActivationSequeneContextProcessor, ShlashInsideAString)
TEST(ActivationSequenceContextProcessor, ShlashInsideAString)
{
ClangCompletionAssistInterface interface("\"foo/bar\"", 5);
ContextProcessor processor{&interface};
......@@ -120,7 +120,7 @@ TEST(ActivationSequeneContextProcessor, ShlashInsideAString)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_EOF_SYMBOL);
}
TEST(ActivationSequeneContextProcessor, ShlashOutsideAString)
TEST(ActivationSequenceContextProcessor, ShlashOutsideAString)
{
ClangCompletionAssistInterface interface("foo/bar", 4);
ContextProcessor processor{&interface};
......@@ -128,7 +128,7 @@ TEST(ActivationSequeneContextProcessor, ShlashOutsideAString)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_EOF_SYMBOL);
}
TEST(ActivationSequeneContextProcessor, FunctionLeftParen)
TEST(ActivationSequenceContextProcessor, FunctionLeftParen)
{
ClangCompletionAssistInterface interface("foo(", 4);
ContextProcessor processor{&interface};
......@@ -136,7 +136,7 @@ TEST(ActivationSequeneContextProcessor, FunctionLeftParen)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_LPAREN);
}
TEST(ActivationSequeneContextProcessor, TemplateFunctionLeftParen)
TEST(ActivationSequenceContextProcessor, TemplateFunctionLeftParen)
{
ClangCompletionAssistInterface interface("foo<X>(", 7);
ContextProcessor processor{&interface};
......@@ -144,7 +144,7 @@ TEST(ActivationSequeneContextProcessor, TemplateFunctionLeftParen)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_LPAREN);
}
TEST(ActivationSequeneContextProcessor, ExpressionLeftParen)
TEST(ActivationSequenceContextProcessor, ExpressionLeftParen)
{
ClangCompletionAssistInterface interface("x * (", 5);
ContextProcessor processor{&interface};
......@@ -152,7 +152,7 @@ TEST(ActivationSequeneContextProcessor, ExpressionLeftParen)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_EOF_SYMBOL);
}
TEST(ActivationSequeneContextProcessor, AngleInclude)
TEST(ActivationSequenceContextProcessor, AngleInclude)
{
ClangCompletionAssistInterface interface("#include <foo/bar>", 10);
ContextProcessor processor{&interface};
......@@ -160,7 +160,7 @@ TEST(ActivationSequeneContextProcessor, AngleInclude)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_ANGLE_STRING_LITERAL);
}
TEST(ActivationSequeneContextProcessor, SlashInclude)
TEST(ActivationSequenceContextProcessor, SlashInclude)
{
ClangCompletionAssistInterface interface("#include <foo/bar>", 14);
ContextProcessor processor{&interface};
......@@ -168,7 +168,7 @@ TEST(ActivationSequeneContextProcessor, SlashInclude)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_SLASH);
}
TEST(ActivationSequeneContextProcessor, QuoteInclude)
TEST(ActivationSequenceContextProcessor, QuoteInclude)
{
ClangCompletionAssistInterface interface("#include \"foo/bar\"", 10);
ContextProcessor processor{&interface};
......@@ -176,7 +176,7 @@ TEST(ActivationSequeneContextProcessor, QuoteInclude)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_STRING_LITERAL);
}
TEST(ActivationSequeneContextProcessor, SlashInExlude)
TEST(ActivationSequenceContextProcessor, SlashInExlude)
{
ClangCompletionAssistInterface interface("#exclude <foo/bar>", 14);
ContextProcessor processor{&interface};
......@@ -184,7 +184,7 @@ TEST(ActivationSequeneContextProcessor, SlashInExlude)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_EOF_SYMBOL);
}
TEST(ActivationSequeneContextProcessor, QuoteExclude)
TEST(ActivationSequenceContextProcessor, QuoteExclude)
{
ClangCompletionAssistInterface interface("#exclude \"foo/bar\"", 10);
ContextProcessor processor{&interface};
......@@ -192,7 +192,7 @@ TEST(ActivationSequeneContextProcessor, QuoteExclude)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_EOF_SYMBOL);
}
TEST(ActivationSequeneContextProcessor, SkipeWhiteSpacesBeforeCursor)
TEST(ActivationSequenceContextProcessor, SkipeWhiteSpacesBeforeCursor)
{
ClangCompletionAssistInterface interface("x-> ", 7);
ContextProcessor processor{&interface};
......@@ -200,7 +200,7 @@ TEST(ActivationSequeneContextProcessor, SkipeWhiteSpacesBeforeCursor)
ASSERT_THAT(processor.completionKind(), CPlusPlus::T_ARROW);
}
TEST(ActivationSequeneContextProcessor, SkipIdentifier)
TEST(ActivationSequenceContextProcessor, SkipIdentifier)
{
ClangCompletionAssistInterface interface("x->foo_", 7);
ContextProcessor processor{&interface};
......
......@@ -54,7 +54,7 @@ static unsigned completionOptions()
: 0;
}
TEST(ClangCodeCompleteResults, GetData)
TEST(ClangCodeCompleteResultsSlowTest, GetData)
{
ProjectPart projectPart(Utf8StringLiteral("projectPartId"));
ClangBackEnd::ProjectParts projects;
......@@ -86,7 +86,7 @@ TEST(ClangCodeCompleteResults, GetInvalidData)
ASSERT_THAT(codeCompleteResults.data(), cxCodeCompleteResults);
}
TEST(ClangCodeCompleteResults, MoveClangCodeCompleteResults)
TEST(ClangCodeCompleteResultsSlowTest, MoveClangCodeCompleteResults)
{
ProjectPart projectPart(Utf8StringLiteral("projectPartId"));
ClangBackEnd::ProjectParts projects;
......
......@@ -40,6 +40,8 @@ protected:
ClangBackEnd::CreateInitialDocumentPreambleJob job;
};
using CreateInitialDocumentPreambleJobSlowTest = CreateInitialDocumentPreambleJob;
TEST_F(CreateInitialDocumentPreambleJob, PrepareAsyncRun)
{
job.setContext(jobContext);
......@@ -47,7 +49,7 @@ TEST_F(CreateInitialDocumentPreambleJob, PrepareAsyncRun)
ASSERT_TRUE(job.prepareAsyncRun());
}
TEST_F(CreateInitialDocumentPreambleJob, RunAsync)
TEST_F(CreateInitialDocumentPreambleJobSlowTest, RunAsync)
{
document.parse();
document.setDirtyIfDependencyIsMet(document.filePath());
......
......@@ -90,6 +90,8 @@ protected:
::Document document;
};
using DocumentSlowTest = Document;
TEST_F(Document, DefaultDocumentIsInvalid)
{
::Document document;
......@@ -135,7 +137,7 @@ TEST_F(Document, ThrowExceptionForGettingCxTranslationUnitForInvalidUnit)
ASSERT_THROW(document.translationUnit().cxIndex(), ClangBackEnd::DocumentIsNullException);
}
TEST_F(Document, CxTranslationUnitGetterIsNonNullForParsedUnit)
TEST_F(DocumentSlowTest, CxTranslationUnitGetterIsNonNullForParsedUnit)
{
document.parse();
......@@ -164,7 +166,7 @@ TEST_F(Document, LastCommandLineArgumentIsFilePath)
ASSERT_THAT(arguments.at(arguments.count() - 1), Eq(nativeFilePath));
}
TEST_F(Document, TimeStampForProjectPartChangeIsUpdatedAsNewCxTranslationUnitIsGenerated)
TEST_F(DocumentSlowTest, TimeStampForProjectPartChangeIsUpdatedAsNewCxTranslationUnitIsGenerated)
{
auto lastChangeTimePoint = document.lastProjectPartChangeTimePoint();
std::this_thread::sleep_for(Duration(1));
......@@ -174,7 +176,7 @@ TEST_F(Document, TimeStampForProjectPartChangeIsUpdatedAsNewCxTranslationUnitIsG
ASSERT_THAT(document.lastProjectPartChangeTimePoint(), Gt(lastChangeTimePoint));
}
TEST_F(Document, TimeStampForProjectPartChangeIsUpdatedAsProjectPartIsCleared)
TEST_F(DocumentSlowTest, TimeStampForProjectPartChangeIsUpdatedAsProjectPartIsCleared)
{
ProjectPart projectPart = document.projectPart();
document.parse();
......@@ -194,7 +196,7 @@ TEST_F(Document, DocumentRevisionInFileContainerGetter)
ASSERT_THAT(document.fileContainer().documentRevision(), 74);
}
TEST_F(Document, DependedFilePaths)
TEST_F(DocumentSlowTest, DependedFilePaths)
{
document.parse();
......@@ -217,7 +219,7 @@ TEST_F(Document, NeedsNoReparseAfterCreation)
ASSERT_FALSE(document.isNeedingReparse());
}
TEST_F(Document, NeedsReparseAfterChangeOfMainFile)
TEST_F(DocumentSlowTest, NeedsReparseAfterChangeOfMainFile)
{
document.parse();
......@@ -226,7 +228,7 @@ TEST_F(Document, NeedsReparseAfterChangeOfMainFile)
ASSERT_TRUE(document.isNeedingReparse());
}
TEST_F(Document, NoNeedForReparsingForIndependendFile)
TEST_F(DocumentSlowTest, NoNeedForReparsingForIndependendFile)
{
document.parse();
......@@ -235,7 +237,7 @@ TEST_F(Document, NoNeedForReparsingForIndependendFile)
ASSERT_FALSE(document.isNeedingReparse());
}
TEST_F(Document, NeedsReparsingForDependendFile)
TEST_F(DocumentSlowTest, NeedsReparsingForDependendFile)
{
document.parse();
......@@ -244,7 +246,7 @@ TEST_F(Document, NeedsReparsingForDependendFile)
ASSERT_TRUE(document.isNeedingReparse());
}
TEST_F(Document, NeedsNoReparsingAfterReparsing)
TEST_F(DocumentSlowTest, NeedsNoReparsingAfterReparsing)
{
document.parse();
document.setDirtyIfDependencyIsMet(Utf8StringLiteral(TESTDATA_DIR"/translationunits.h"));
......@@ -254,7 +256,7 @@ TEST_F(Document, NeedsNoReparsingAfterReparsing)
ASSERT_FALSE(document.isNeedingReparse());
}
TEST_F(Document, IsIntactAfterParsing)
TEST_F(DocumentSlowTest, IsIntactAfterParsing)
{
document.parse();
......@@ -268,14 +270,14 @@ TEST_F(Document, IsNotIntactForDeletedFile)
ASSERT_FALSE(document.isIntact());
}
TEST_F(Document, DoesNotNeedReparseAfterParse)
TEST_F(DocumentSlowTest, DoesNotNeedReparseAfterParse)
{
document.parse();
ASSERT_FALSE(document.isNeedingReparse());
}
TEST_F(Document, NeedsReparseAfterMainFileChanged)
TEST_F(DocumentSlowTest, NeedsReparseAfterMainFileChanged)
{
document.parse();
......@@ -284,7 +286,7 @@ TEST_F(Document, NeedsReparseAfterMainFileChanged)
ASSERT_TRUE(document.isNeedingReparse());
}
TEST_F(Document, NeedsReparseAfterIncludedFileChanged)
TEST_F(DocumentSlowTest, NeedsReparseAfterIncludedFileChanged)
{
document.parse();
......@@ -293,7 +295,7 @@ TEST_F(Document, NeedsReparseAfterIncludedFileChanged)
ASSERT_TRUE(document.isNeedingReparse());
}
TEST_F(Document, DoesNotNeedReparseAfterNotIncludedFileChanged)
TEST_F(DocumentSlowTest, DoesNotNeedReparseAfterNotIncludedFileChanged)
{
document.parse();
......@@ -302,7 +304,7 @@ TEST_F(Document, DoesNotNeedReparseAfterNotIncludedFileChanged)
ASSERT_FALSE(document.isNeedingReparse());
}
TEST_F(Document, DoesNotNeedReparseAfterReparse)
TEST_F(DocumentSlowTest, DoesNotNeedReparseAfterReparse)
{
document.parse();
document.setDirtyIfDependencyIsMet(documentFilePath);
......@@ -323,7 +325,7 @@ TEST_F(Document, SetDirtyIfProjectPartIsOutdated)
ASSERT_TRUE(document.isNeedingReparse());
}
TEST_F(Document, SetNotDirtyIfProjectPartIsNotOutdated)
TEST_F(DocumentSlowTest, SetNotDirtyIfProjectPartIsNotOutdated)
{
document.parse();
......
......@@ -72,6 +72,8 @@ protected:
dummyIpcClient};
};
using DocumentProcessorSlowTest = DocumentProcessor;
TEST_F(DocumentProcessor, ProcessEmpty)
{
const JobRequests jobsStarted = documentProcessor.process();
......@@ -79,7 +81,7 @@ TEST_F(DocumentProcessor, ProcessEmpty)
ASSERT_THAT(jobsStarted.size(), 0);
}
TEST_F(DocumentProcessor, ProcessSingleJob)
TEST_F(DocumentProcessorSlowTest, ProcessSingleJob)
{
const JobRequest jobRequest = createJobRequest(JobRequest::Type::UpdateDocumentAnnotations);
documentProcessor.addJob(jobRequest);
......
......@@ -78,6 +78,8 @@ protected:
dummyIpcClient};
};
using DocumentProcessorsSlowTest = DocumentProcessors;
TEST_F(DocumentProcessors, HasNoItemsInitially)
{
ASSERT_TRUE(documentProcessors.processors().empty());
......@@ -144,7 +146,7 @@ TEST_F(DocumentProcessors, ProcessEmpty)
ASSERT_TRUE(jobsStarted.isEmpty());
}
TEST_F(DocumentProcessors, ProcessSingle)
TEST_F(DocumentProcessorsSlowTest, ProcessSingle)
{
DocumentProcessor documentProcessor = documentProcessors.create(document);
const JobRequest jobRequest = createJobRequest(JobRequest::Type::UpdateDocumentAnnotations);
......
......@@ -83,6 +83,8 @@ protected:
const ClangBackEnd::FileContainer headerContainer{headerPath, projectPartId};
};
using DocumentsSlowTest = Documents;
TEST_F(Documents, ThrowForGettingWithWrongFilePath)
{
ASSERT_THROW(documents.document(nonExistingFilePath, projectPartId),
......@@ -199,7 +201,7 @@ TEST_F(Documents, UpdateMultiple)
IsDocument(filePath, otherProjectPartId, 75u));
}
TEST_F(Documents, UpdateUnsavedFileAndCheckForReparse)
TEST_F(DocumentsSlowTest, UpdateUnsavedFileAndCheckForReparse)
{
ClangBackEnd::FileContainer fileContainer(filePath, projectPartId, Utf8StringVector(), 74u);
ClangBackEnd::FileContainer headerContainer(headerPath, projectPartId, Utf8StringVector(), 74u);
......@@ -213,7 +215,7 @@ TEST_F(Documents, UpdateUnsavedFileAndCheckForReparse)
ASSERT_TRUE(documents.document(filePath, projectPartId).isNeedingReparse());
}
TEST_F(Documents, RemoveFileAndCheckForReparse)
TEST_F(DocumentsSlowTest, RemoveFileAndCheckForReparse)
{
ClangBackEnd::FileContainer fileContainer(filePath, projectPartId, Utf8StringVector(), 74u);
ClangBackEnd::FileContainer headerContainer(headerPath, projectPartId, Utf8StringVector(), 74u);
......
This diff is collapsed.
......@@ -74,6 +74,8 @@ protected:
ClangBackEnd::Jobs jobs{documents, unsavedFiles, projects, dummyClientInterface};
};
using JobsSlowTest = Jobs;
TEST_F(Jobs, ProcessEmptyQueue)
{
const JobRequests jobsStarted = jobs.process();
......@@ -82,7 +84,7 @@ TEST_F(Jobs, ProcessEmptyQueue)
ASSERT_TRUE(jobs.runningJobs().isEmpty());
}
TEST_F(Jobs, ProcessQueueWithSingleJob)
TEST_F(JobsSlowTest, ProcessQueueWithSingleJob)
{
jobs.add(createJobRequest(filePath1, JobRequest::Type::UpdateDocumentAnnotations));
......@@ -92,7 +94,7 @@ TEST_F(Jobs, ProcessQueueWithSingleJob)
ASSERT_THAT(jobs.runningJobs().size(), Eq(1));
}
TEST_F(Jobs, ProcessQueueUntilEmpty)
TEST_F(JobsSlowTest, ProcessQueueUntilEmpty)
{
jobs.add(createJobRequest(filePath1, JobRequest::Type::UpdateDocumentAnnotations));
jobs.add(createJobRequest(filePath1, JobRequest::Type::UpdateDocumentAnnotations));
......@@ -103,7 +105,7 @@ TEST_F(Jobs, ProcessQueueUntilEmpty)
waitUntilJobChainFinished();
}
TEST_F(Jobs, IsJobRunning)
TEST_F(JobsSlowTest, IsJobRunning)
{
jobs.add(createJobRequest(filePath1, JobRequest::Type::UpdateDocumentAnnotations));
jobs.process();
......
......@@ -47,6 +47,8 @@ protected:
ClangBackEnd::ParseSupportiveTranslationUnitJob job;
};
using ParseSupportiveTranslationUnitJobSlowTest = ParseSupportiveTranslationUnitJob;
TEST_F(ParseSupportiveTranslationUnitJob, PrepareAsyncRun)
{
job.setContext(jobContext);
......@@ -54,7 +56,7 @@ TEST_F(ParseSupportiveTranslationUnitJob, PrepareAsyncRun)
ASSERT_TRUE(job.prepareAsyncRun());
}
TEST_F(ParseSupportiveTranslationUnitJob, RunAsync)
TEST_F(ParseSupportiveTranslationUnitJobSlowTest, RunAsync)
{
job.setContext(jobContext);
job.prepareAsyncRun();
......@@ -64,7 +66,7 @@ TEST_F(ParseSupportiveTranslationUnitJob, RunAsync)
ASSERT_TRUE(waitUntilJobFinished(job));
}
TEST_F(ParseSupportiveTranslationUnitJob, DoNotIncorporateUpdaterResult)
TEST_F(ParseSupportiveTranslationUnitJobSlowTest, DoNotIncorporateUpdaterResult)
{
const TimePoint parseTimePointBefore = parseTimePointOfDocument();
job.setContext(jobContext);
......
......@@ -47,6 +47,7 @@ protected:
::ClangQuery simpleClassQuery;
};
using ClangQuerySlowTest = ClangQuery;
TEST_F(ClangQuery, NoSourceRangesForDefaultConstruction)
{
......@@ -55,7 +56,7 @@ TEST_F(ClangQuery, NoSourceRangesForDefaultConstruction)
ASSERT_THAT(sourceRanges.sourceRangeWithTextContainers(), IsEmpty());
}
TEST_F(ClangQuery, SourceRangesForSimpleFunctionDeclarationAreNotEmpty)
TEST_F(ClangQuerySlowTest, SourceRangesForSimpleFunctionDeclarationAreNotEmpty)
{
simpleFunctionQuery.setQuery("functionDecl()");
......@@ -64,7 +65,7 @@ TEST_F(ClangQuery, SourceRangesForSimpleFunctionDeclarationAreNotEmpty)
ASSERT_THAT(simpleFunctionQuery.takeSourceRanges().sourceRangeWithTextContainers(), Not(IsEmpty()));
}
TEST_F(ClangQuery, RootSourceRangeForSimpleFunctionDeclarationRange)
TEST_F(ClangQuerySlowTest, RootSourceRangeForSimpleFunctionDeclarationRange)
{
simpleFunctionQuery.setQuery("functionDecl()");
......@@ -74,7 +75,7 @@ TEST_F(ClangQuery, RootSourceRangeForSimpleFunctionDeclarationRange)
IsSourceRangeWithText(1, 1, 8, 2, "int function(int* pointer, int value)\n{\n if (pointer == nullptr) {\n return value + 1;\n } else {\n return value - 1;\n }\n}"));
}
TEST_F(ClangQuery, SourceRangeInUnsavedFileDeclarationRange)
TEST_F(ClangQuerySlowTest, SourceRangeInUnsavedFileDeclarationRange)
{
::ClangQuery query;
query.addFile(TESTDATA_DIR, "query_simplefunction.cpp", "#include \"unsaved.h\"", {"cc", "query_simplefunction.cpp", "-std=c++14"});
......@@ -88,7 +89,7 @@ TEST_F(ClangQuery, SourceRangeInUnsavedFileDeclarationRange)
IsSourceRangeWithText(1, 1, 1, 15, "void unsaved();"));
}
TEST_F(ClangQuery, RootSourceRangeForSimpleFieldDeclarationRange)
TEST_F(ClangQuerySlowTest, RootSourceRangeForSimpleFieldDeclarationRange)
{
simpleClassQuery.setQuery("fieldDecl(hasType(isInteger()))");
......@@ -98,14 +99,14 @@ TEST_F(ClangQuery, RootSourceRangeForSimpleFieldDeclarationRange)
IsSourceRangeWithText(4, 5, 4, 10, " int x;"));
}
TEST_F(ClangQuery, NoSourceRangesForEmptyQuery)
TEST_F(ClangQuerySlowTest, NoSourceRangesForEmptyQuery)
{
simpleClassQuery.findLocations();
ASSERT_THAT(simpleClassQuery.takeSourceRanges().sourceRangeWithTextContainers(), IsEmpty());
}
TEST_F(ClangQuery, NoSourceRangesForWrongQuery)
TEST_F(ClangQuerySlowTest, NoSourceRangesForWrongQuery)
{
simpleClassQuery.setQuery("wrongQuery()");
......@@ -114,14 +115,14 @@ TEST_F(ClangQuery, NoSourceRangesForWrongQuery)
ASSERT_THAT(simpleClassQuery.takeSourceRanges().sourceRangeWithTextContainers(), IsEmpty());
}
TEST_F(ClangQuery, NoDiagnosticsForDefaultConstruction)
TEST_F(ClangQuerySlowTest, NoDiagnosticsForDefaultConstruction)
{
auto diagnostics = simpleFunctionQuery.takeDiagnosticContainers();
ASSERT_THAT(diagnostics, IsEmpty());
}
TEST_F(ClangQuery, DiagnosticsForEmptyQuery)
TEST_F(ClangQuerySlowTest, DiagnosticsForEmptyQuery)
{
simpleFunctionQuery.findLocations();
......@@ -129,7 +130,7 @@ TEST_F(ClangQuery, DiagnosticsForEmptyQuery)
Not(IsEmpty()));
}
TEST_F(ClangQuery, DiagnosticsForWrongQuery)
TEST_F(ClangQuerySlowTest, DiagnosticsForWrongQuery)
{
simpleClassQuery.setQuery("wrongQuery()");
......@@ -139,7 +140,7 @@ TEST_F(ClangQuery, DiagnosticsForWrongQuery)
Not(IsEmpty()));
}
TEST_F(ClangQuery, NoDiagnosticsForAccurateQuery)
TEST_F(ClangQuerySlowTest, NoDiagnosticsForAccurateQuery)
{
simpleFunctionQuery.setQuery("functionDecl()");
......@@ -149,7 +150,7 @@ TEST_F(ClangQuery, NoDiagnosticsForAccurateQuery)
IsEmpty());
}
TEST_F(ClangQuery, DiagnosticForWrongQuery)
TEST_F(ClangQuerySlowTest, DiagnosticForWrongQuery)
{
simpleClassQuery.setQuery("wrongQuery()");
......@@ -159,7 +160,7 @@ TEST_F(ClangQuery, DiagnosticForWrongQuery)
HasDiagnosticMessage("RegistryMatcherNotFound", 1, 1, 1, 11));
}
TEST_F(ClangQuery, DiagnosticForWrongArgumenType)
TEST_F(ClangQuerySlowTest, DiagnosticForWrongArgumenType)
{
simpleFunctionQuery.setQuery("functionDecl(1)");
......
......@@ -48,6 +48,8 @@ protected:
ClangBackEnd::ReparseSupportiveTranslationUnitJob job;
};
using ReparseSupportiveTranslationUnitJobSlowTest = ReparseSupportiveTranslationUnitJob;
TEST_F(ReparseSupportiveTranslationUnitJob, PrepareAsyncRun)
{
job.setContext(jobContext);
......@@ -55,7 +57,7 @@ TEST_F(ReparseSupportiveTranslationUnitJob, PrepareAsyncRun)
ASSERT_TRUE(job.prepareAsyncRun());
}
TEST_F(ReparseSupportiveTranslationUnitJob, RunAsync)
TEST_F(ReparseSupportiveTranslationUnitJobSlowTest, RunAsync)
{
parse();
job.setContext(jobContext);
......@@ -66,7 +68,7 @@ TEST_F(ReparseSupportiveTranslationUnitJob, RunAsync)
ASSERT_TRUE(waitUntilJobFinished(job));
}
TEST_F(ReparseSupportiveTranslationUnitJob, IncorporateUpdaterResult)
TEST_F(ReparseSupportiveTranslationUnitJobSlowTest, IncorporateUpdaterResult)
{
parse();
const TimePoint parseTimePointBefore = parseTimePointOfDocument();
......@@ -79,7 +81,7 @@ TEST_F(ReparseSupportiveTranslationUnitJob, IncorporateUpdaterResult)
ASSERT_THAT(parseTimePointOfDocument(), Not(Eq(parseTimePointBefore)));
}
TEST_F(ReparseSupportiveTranslationUnitJob, DoNotIncorporateUpdaterResultIfDocumentWasClosed)
TEST_F(ReparseSupportiveTranslationUnitJobSlowTest, DoNotIncorporateUpdaterResultIfDocumentWasClosed)
{
parse();
const TimePoint parseTimePointBefore = parseTimePointOfDocument();
......
......@@ -132,6 +132,8 @@ protected:
ClangBackEnd::SupportiveTranslationUnitInitializer &initializer = *d.initializer;
};
using SupportiveTranslationUnitInitializerSlowTest = SupportiveTranslationUnitInitializer;
TEST_F(SupportiveTranslationUnitInitializer, HasInitiallyNotInitializedState)
{
ASSERT_THAT(initializer.state(), Eq(ClangBackEnd::SupportiveTranslationUnitInitializer::State::NotInitialized));
......@@ -147,7 +149,7 @@ TEST_F(SupportiveTranslationUnitInitializer, StartInitializingAbortsIfDocumentIs
ASSERT_THAT(initializer.state(), Eq(ClangBackEnd::SupportiveTranslationUnitInitializer::State::Aborted));
}
TEST_F(SupportiveTranslationUnitInitializer, StartInitializingAddsTranslationUnit)
TEST_F(SupportiveTranslationUnitInitializerSlowTest, StartInitializingAddsTranslationUnit)
{
initializer.startInitializing();
......@@ -155,7 +157,7 @@ TEST_F(SupportiveTranslationUnitInitializer, StartInitializingAddsTranslationUni
ASSERT_FALSE(document.translationUnits().areAllTranslationUnitsParsed());
}
TEST_F(SupportiveTranslationUnitInitializer, StartInitializingStartsJob)
TEST_F(SupportiveTranslationUnitInitializerSlowTest, StartInitializingStartsJob)
{
initializer.startInitializing();
......@@ -176,7 +178,7 @@ TEST_F(SupportiveTranslationUnitInitializer, CheckIfParseJobFinishedAbortsIfDocu
ASSERT_THAT(initializer.state(), Eq(ClangBackEnd::SupportiveTranslationUnitInitializer::State::Aborted));
}
TEST_F(SupportiveTranslationUnitInitializer, CheckIfParseJobFinishedStartsJob)
TEST_F(SupportiveTranslationUnitInitializerSlowTest, CheckIfParseJobFinishedStartsJob)
{
parse();
initializer.setState(ClangBackEnd::SupportiveTranslationUnitInitializer::State::WaitingForParseJob);
......@@ -202,7 +204,7 @@ TEST_F(SupportiveTranslationUnitInitializer, CheckIfReparseJobFinishedAbortsIfDo
ASSERT_THAT(initializer.state(), Eq(ClangBackEnd::SupportiveTranslationUnitInitializer::State::Aborted));
}
TEST_F(SupportiveTranslationUnitInitializer, CheckIfReparseJobFinishedStartsJob)
TEST_F(SupportiveTranslationUnitInitializerSlowTest, CheckIfReparseJobFinishedStartsJob)
{
parse();
initializer.setState(ClangBackEnd::SupportiveTranslationUnitInitializer::State::WaitingForReparseJob);
......@@ -215,7 +217,7 @@ TEST_F(SupportiveTranslationUnitInitializer, CheckIfReparseJobFinishedStartsJob)
ASSERT_THAT(initializer.state(), Eq(ClangBackEnd::SupportiveTranslationUnitInitializer::State::Initialized));
}
TEST_F(SupportiveTranslationUnitInitializer, FullRun)
TEST_F(SupportiveTranslationUnitInitializerSlowTest, FullRun)
{
parse();
initializer.startInitializing();
......
......@@ -73,7 +73,9 @@ protected:
QVector<DiagnosticContainer> extractedMainFileDiagnostics;
};
TEST_F(TranslationUnit, HasExpectedMainFileDiagnostics)
using TranslationUnitSlowTest = TranslationUnit;
TEST_F(TranslationUnitSlowTest, HasExpectedMainFileDiagnostics)
{
translationUnit.extractDiagnostics(extractedFirstHeaderErrorDiagnostic,
extractedMainFileDiagnostics);
......@@ -81,7 +83,7 @@ TEST_F(TranslationUnit, HasExpectedMainFileDiagnostics)
ASSERT_THAT(extractedMainFileDiagnostics, ContainerEq(diagnosticsFromMainFile()));
}
TEST_F(TranslationUnit, HasExpectedMainFileDiagnosticsAfterReparse)
TEST_F(TranslationUnitSlowTest, HasExpectedMainFileDiagnosticsAfterReparse)
{
reparse();
......@@ -91,7 +93,7 @@ TEST_F(TranslationUnit, HasExpectedMainFileDiagnosticsAfterReparse)
ASSERT_THAT(extractedMainFileDiagnostics, ContainerEq(diagnosticsFromMainFile()));
}
TEST_F(TranslationUnit, HasErrorDiagnosticsInHeaders)
TEST_F(TranslationUnitSlowTest, HasErrorDiagnosticsInHeaders)
{