1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
|
/* This file is part of KDevelop
Copyright 2006 Hamish Rodda <rodda@kde.org>
Copyright 2007-2009 David Nolden <david.nolden.kdevelop@art-master.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef TESTDUCHAIN_H
#define TESTDUCHAIN_H
#include <QObject>
#include <QByteArray>
#include <kurl.h>
#include <language/duchain/identifier.h>
#include <language/duchain/types/indexedtype.h>
#include <language/editor/cursorinrevision.h>
#include "testhelper.h"
namespace KDevelop
{
class Declaration;
class TopDUContext;
class ClassFunctionDeclaration;
}
class TestDUChain : public QObject, public Cpp::TestHelper
{
Q_OBJECT
public:
TestDUChain();
KDevelop::Declaration* findDeclaration(KDevelop::DUContext* context, const KDevelop::Identifier& id, const KDevelop::CursorInRevision& position = KDevelop::CursorInRevision::invalid());
KDevelop::Declaration* findDeclaration(KDevelop::DUContext* context, const KDevelop::QualifiedIdentifier& id, const KDevelop::CursorInRevision& position = KDevelop::CursorInRevision::invalid());
//Move to slots again once it should be tested
void testFileParse();
private slots:
void initTestCase();
void cleanupTestCase();
void testTypeof();
void testIdentifiers();
void testContextRelationships();
void testDeclareInt();
void testIntegralTypes();
void testConversionReturn();
void testArrayType();
void testDeclareFor();
void testVariableDeclaration();
void testDeclareStruct();
void testDeclareStructInNamespace();
void testDeclareClass();
void testDeclareFriend();
void testDeclareNamespace();
void testDeclareNamespace2();
void testGlobalNamespaceAlias();
void testGlobalNamespaceAliasCycle();
void testLocalNamespaceAlias();
void testDeclareUsingNamespace();
void testUsingDeclaration();
void testUsingDeclarationInTemplate();
void testDeclareUsingNamespace2();
void testUsingGlobalNamespaceAlias();
void testUsingGlobalNamespaceAliasCycle();
void testSearchAcrossNamespace();
void testSearchAcrossNamespace2();
void testSearchAcrossNamespace3();
void testADL();
void testADLConstness();
void testADLConstness2();
void testADLClassType();
void testADLFunctionType();
void testADLFunctionByName();
void testADLEnumerationType();
void testADLClassMembers();
void testADLMemberFunction();
void testADLMemberFunctionByName();
void testADLOperators();
void testADLNameAlias();
void testADLTemplateArguments();
void testADLTemplateTemplateArguments();
void testADLEllipsis();
void testAssignmentOperators();
void testTemplateEnums();
void testIntegralTemplates();
void testTypedef();
void testTypedefUnsignedInt();
void testTypedefFuncptr();
void testTemplateDependentClass();
void testTemplateFunctions();
void testTypedefUses();
void testTemplateReference();
void testSimplifiedTypeString();
void testSourceCodeInsertion();
void testTemplates();
void testTemplates2();
void testTemplates3();
void testTemplates4();
void testSpecializationSelection();
void testSpecializationSelection2();
void testTemplatesRebind();
void testTemplatesRebind2();
void testTemplateDefaultParameters();
void testTemplateParameters();
void testFunctionTemplates();
void testContextAssignment();
void testSpecializedTemplates();
void testTemplatesSuper();
void testFunctionDefinition();
void testFunctionDefinition2();
void testFunctionDefinition3();
void testFunctionDefinition4();
void testFunctionDefinition5();
void testFunctionDefinition6();
void testFunctionDefinition7();
void testMetaProgramming();
void testMetaProgramming2();
void testMetaProgramming3();
void testSignalSlotDeclaration();
void testSignalSlotUse();
void testBaseClasses();
void testForwardDeclaration();
void testForwardDeclaration2();
void testForwardDeclaration3();
void testForwardDeclaration4();
void testTemplateForwardDeclaration();
void testTemplateForwardDeclaration2();
void testTemplateRecursiveInstantiation();
void testTemplateInternalSearch();
void testTemplateImplicitInstantiations();
void testAssignedContexts();
void testTryCatch();
void testEnum();
void testCaseUse();
void testConstructorOperatorUses();
void testSizeofUse();
void testDefinitionUse();
void testOperatorUses();
void testDeclareSubClass();
void testDeclarationId();
void testConst();
void testEnumOverride();
void testDoWhile();
void testCodeModel();
void testLoopNamespaceImport();
void testConstructorUses();
void testExternalMemberDeclaration();
void testSeparateVariableDefinition();
void testBaseUses();
void testProblematicUses();
void testCStruct();
void testCStruct2();
void testVirtualMemberFunction();
void testNonVirtualMemberFunction();
void testMultipleVirtual();
void testMixedVirtualNormal();
void testMemberFunctionModifiers();
void testContextSearch();
void testEllipsis();
void testEllipsisVexing();
void testMultiByteCStrings();
void testUses();
void testCtorTypes();
void testAutoTypeIntegral_data();
void testAutoTypeIntegral();
void testAutoTypes();
void testCommentAfterFunctionCall();
void testPointerToMember();
void testMemberPtrCrash();
void testNestedNamespace();
void testDeclarationHasUses();
void testBug269352();
void testRenameClass();
void testQProperty();
//BEGIN C++2011
void testRangeBasedFor();
void testRangeBasedForClass();
void testRangeBasedForClass2();
void testRValueReference();
void testDefaultDelete();
void testDelete_Bug278781();
void testEnum2011_data();
void testEnum2011();
void testDecltype();
void testDecltypeTypedef();
void testDecltypeUses();
void testTrailingReturnType();
void testConstexpr();
void testInitListRegressions();
void testBug284536();
void testBug285004();
void testLambda();
void testLambdaReturn();
void testLambdaCapture();
void testTemplateSpecializeArray();
void testTemplateSpecializeRValue();
void testTemplateSpecializeVolatile();
void testAliasDeclaration();
void testAuto();
void testNoexcept();
void testInlineNamespace();
//END C++2011
private:
void assertNoMemberFunctionModifiers(KDevelop::ClassFunctionDeclaration* memberFun);
public:
private:
// Declaration - use chain
KDevelop::Declaration* noDef;
KUrl file1, file2;
KDevelop::TopDUContext* topContext;
KDevelop::IndexedType typeVoid;
KDevelop::IndexedType typeInt;
KDevelop::IndexedType typeShort;
bool testFileParseOnly;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(TestDUChain::DumpAreas)
#endif
|