Clang: Tests: Clarify test names

Change-Id: Ic27c4f9473fc215aee7aa6acdb0496388be2360d
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-09-16 15:24:59 +02:00
parent 7b631d484d
commit 08bf761834
2 changed files with 42 additions and 42 deletions

View File

@@ -970,7 +970,7 @@ void ClangCodeCompletionTest::testCompleteConstructorAndFallbackToGlobalCompleti
QVERIFY(!hasSnippet(t.proposal, "class")); QVERIFY(!hasSnippet(t.proposal, "class"));
} }
void ClangCodeCompletionTest::testProjectDependentCompletion() void ClangCodeCompletionTest::testCompleteProjectDependingCode()
{ {
const TestDocument testDocument("completionWithProject.cpp"); const TestDocument testDocument("completionWithProject.cpp");
QVERIFY(testDocument.isCreatedAndHasValidCursorPosition()); QVERIFY(testDocument.isCreatedAndHasValidCursorPosition());
@@ -986,7 +986,7 @@ void ClangCodeCompletionTest::testProjectDependentCompletion()
QVERIFY(hasItem(proposal, "projectConfiguration1")); QVERIFY(hasItem(proposal, "projectConfiguration1"));
} }
void ClangCodeCompletionTest::testChangingProjectDependentCompletion() void ClangCodeCompletionTest::testCompleteProjectDependingCodeAfterChangingProject()
{ {
const TestDocument testDocument("completionWithProject.cpp"); const TestDocument testDocument("completionWithProject.cpp");
QVERIFY(testDocument.isCreatedAndHasValidCursorPosition()); QVERIFY(testDocument.isCreatedAndHasValidCursorPosition());
@@ -1025,7 +1025,36 @@ void ClangCodeCompletionTest::testChangingProjectDependentCompletion()
QVERIFY(hasItem(proposal, "noProjectConfigurationDetected")); QVERIFY(hasItem(proposal, "noProjectConfigurationDetected"));
} }
void ClangCodeCompletionTest::testUnsavedFilesTrackingByModifyingIncludedFileInCurrentEditor() void ClangCodeCompletionTest::testCompleteProjectDependingCodeInGeneratedUiFile()
{
CppTools::Tests::TemporaryCopiedDir testDir(qrcPath("qt-widgets-app"));
QVERIFY(testDir.isValid());
MonitorGeneratedUiFile monitorGeneratedUiFile;
// Open project
const QString projectFilePath = testDir.absolutePath("qt-widgets-app.pro");
CppTools::Tests::ProjectOpenerAndCloser projectManager;
const CppTools::ProjectInfo projectInfo = projectManager.open(projectFilePath, true);
QVERIFY(projectInfo.isValid());
// Open file with ui object
const QString completionFile = testDir.absolutePath("mainwindow.cpp");
const TestDocument testDocument = TestDocument::fromExistingFile(completionFile);
QVERIFY(testDocument.isCreatedAndHasValidCursorPosition());
OpenEditorAtCursorPosition openSource(testDocument);
QVERIFY(openSource.succeeded());
// ...and check comletions
QVERIFY(monitorGeneratedUiFile.waitUntilGenerated());
ProposalModel proposal = completionResults(openSource.editor());
QVERIFY(hasItem(proposal, "menuBar"));
QVERIFY(hasItem(proposal, "statusBar"));
QVERIFY(hasItem(proposal, "centralWidget"));
QVERIFY(hasItem(proposal, "setupUi"));
}
void ClangCodeCompletionTest::testCompleteAfterModifyingIncludedHeaderInOtherEditor()
{ {
CppTools::Tests::TemporaryDir temporaryDir; CppTools::Tests::TemporaryDir temporaryDir;
const TestDocument sourceDocument("mysource.cpp", &temporaryDir); const TestDocument sourceDocument("mysource.cpp", &temporaryDir);
@@ -1051,7 +1080,7 @@ void ClangCodeCompletionTest::testUnsavedFilesTrackingByModifyingIncludedFileInC
QVERIFY(hasItem(proposal, "globalFromHeaderUnsaved")); QVERIFY(hasItem(proposal, "globalFromHeaderUnsaved"));
} }
void ClangCodeCompletionTest::testUnsavedFilesTrackingByModifyingIncludedFileInNotCurrentEditor() void ClangCodeCompletionTest::testCompleteAfterModifyingIncludedHeaderByRefactoringActions()
{ {
CppTools::Tests::TemporaryDir temporaryDir; CppTools::Tests::TemporaryDir temporaryDir;
const TestDocument sourceDocument("mysource.cpp", &temporaryDir); const TestDocument sourceDocument("mysource.cpp", &temporaryDir);
@@ -1082,7 +1111,7 @@ void ClangCodeCompletionTest::testUnsavedFilesTrackingByModifyingIncludedFileInN
QVERIFY(hasItem(proposal, "globalFromHeaderUnsaved")); QVERIFY(hasItem(proposal, "globalFromHeaderUnsaved"));
} }
void ClangCodeCompletionTest::testUnsavedFilesTrackingByModifyingIncludedFileExternally() void ClangCodeCompletionTest::testCompleteAfterChangingIncludedAndOpenHeaderExternally()
{ {
QSKIP("The file system watcher is doing it in backend process but we wait not long enough"); QSKIP("The file system watcher is doing it in backend process but we wait not long enough");
@@ -1116,7 +1145,7 @@ void ClangCodeCompletionTest::testUnsavedFilesTrackingByModifyingIncludedFileExt
QVERIFY(hasItem(proposal, "globalFromHeaderReloaded")); QVERIFY(hasItem(proposal, "globalFromHeaderReloaded"));
} }
void ClangCodeCompletionTest::testUnsavedFilesTrackingByModifyingIncludedFileExternally2() void ClangCodeCompletionTest::testCompleteAfterChangingIncludedAndNotOpenHeaderExternally()
{ {
QSKIP("The file system watcher is doing it in backend process but we wait not long enough"); QSKIP("The file system watcher is doing it in backend process but we wait not long enough");
@@ -1140,35 +1169,6 @@ void ClangCodeCompletionTest::testUnsavedFilesTrackingByModifyingIncludedFileExt
QVERIFY(hasItem(proposal, "globalFromHeaderReloaded")); QVERIFY(hasItem(proposal, "globalFromHeaderReloaded"));
} }
void ClangCodeCompletionTest::testUnsavedFilesTrackingByCompletingUiObject()
{
CppTools::Tests::TemporaryCopiedDir testDir(qrcPath("qt-widgets-app"));
QVERIFY(testDir.isValid());
MonitorGeneratedUiFile monitorGeneratedUiFile;
// Open project
const QString projectFilePath = testDir.absolutePath("qt-widgets-app.pro");
CppTools::Tests::ProjectOpenerAndCloser projectManager;
const CppTools::ProjectInfo projectInfo = projectManager.open(projectFilePath, true);
QVERIFY(projectInfo.isValid());
// Open file with ui object
const QString completionFile = testDir.absolutePath("mainwindow.cpp");
const TestDocument testDocument = TestDocument::fromExistingFile(completionFile);
QVERIFY(testDocument.isCreatedAndHasValidCursorPosition());
OpenEditorAtCursorPosition openSource(testDocument);
QVERIFY(openSource.succeeded());
// ...and check comletions
QVERIFY(monitorGeneratedUiFile.waitUntilGenerated());
ProposalModel proposal = completionResults(openSource.editor());
QVERIFY(hasItem(proposal, "menuBar"));
QVERIFY(hasItem(proposal, "statusBar"));
QVERIFY(hasItem(proposal, "centralWidget"));
QVERIFY(hasItem(proposal, "setupUi"));
}
void ClangCodeCompletionTest::testUpdateBackendAfterRestart() void ClangCodeCompletionTest::testUpdateBackendAfterRestart()
{ {
QSKIP("Must be rewritten with a more robust approach instead of sender log!"); QSKIP("Must be rewritten with a more robust approach instead of sender log!");

View File

@@ -59,14 +59,14 @@ private slots:
void testCompleteFunctions(); void testCompleteFunctions();
void testCompleteConstructorAndFallbackToGlobalCompletion(); void testCompleteConstructorAndFallbackToGlobalCompletion();
void testProjectDependentCompletion(); void testCompleteProjectDependingCode();
void testChangingProjectDependentCompletion(); void testCompleteProjectDependingCodeAfterChangingProject();
void testCompleteProjectDependingCodeInGeneratedUiFile();
void testUnsavedFilesTrackingByModifyingIncludedFileInCurrentEditor(); void testCompleteAfterModifyingIncludedHeaderInOtherEditor();
void testUnsavedFilesTrackingByModifyingIncludedFileInNotCurrentEditor(); void testCompleteAfterModifyingIncludedHeaderByRefactoringActions();
void testUnsavedFilesTrackingByModifyingIncludedFileExternally(); void testCompleteAfterChangingIncludedAndOpenHeaderExternally();
void testUnsavedFilesTrackingByModifyingIncludedFileExternally2(); void testCompleteAfterChangingIncludedAndNotOpenHeaderExternally();
void testUnsavedFilesTrackingByCompletingUiObject();
void testUpdateBackendAfterRestart(); void testUpdateBackendAfterRestart();