File: pyduchaintest.h

package info (click to toggle)
kdevelop-python 24.12.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,640 kB
  • sloc: python: 183,048; cpp: 18,798; xml: 140; sh: 14; makefile: 9
file content (97 lines) | stat: -rw-r--r-- 2,781 bytes parent folder | download
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
/*
    SPDX-FileCopyrightText: 2010 Miquel Canes Gonzalez <miquelcanes@gmail.com>
    SPDX-FileCopyrightText: 2011-2012 Sven Brauch <svenbrauch@googlemail.com>

    SPDX-License-Identifier: MIT
*/

#ifndef PYDUCHAINTEST_H
#define PYDUCHAINTEST_H

#include <QObject>
#include <QTemporaryDir>
#include "ast.h"
#include <serialization/indexedstring.h>
#include <language/duchain/topducontext.h>
#include <tests/testfile.h>

namespace KDevelop {
class TopDUContext;
class ReferencedTopDUContext;
}

using namespace KDevelop;

class PyDUChainTest : public QObject
{
    Q_OBJECT
    public:
        explicit PyDUChainTest(QObject* parent = nullptr);
        void initShell();
        ~PyDUChainTest() override;

        KDevelop::ReferencedTopDUContext parse(const QString& code);
        
        Python::CodeAst::Ptr m_ast;
        
    private Q_SLOTS:
        void init();
        void testSimple();
        void testSimple_data();
        void testRanges();
        void testRanges_data();
        void testTypes();
        void testTypes_data();
        void testImportDeclarations();
        void testImportDeclarations_data();
        void testImportFiles();
        void testCrashes();
        void testCrashes_data();
        void testFlickering();
        void testFlickering_data();
        void testFunctionArgs();
        void testAutocompletionFlickering();
        void testContainerTypes();
        void testContainerTypes_data();
        void testInheritance();
        void testInheritance_data();
        void testClassVariables();
        void testWarnNewNotCls();
        void testWarnNewNotCls_data();
        void testBinaryOperatorsUnsure();
        void testBinaryOperatorsUnsure_data();
        void testClassContextRanges();
        void testVarKWArgs();
        void testMultiFromImport();
        void testMultiFromImport_data();
        void testRelativeImport();
        void testRelativeImport_data();
        void testCannotOverwriteBuiltins();
        void testFunctionHints();
        void testFunctionHints_data();
        void testCannotOverwriteBuiltins_data();
        void testOperators();
        void testOperators_data();
        void testVariableCreation();
        void testVariableCreation_data();
        void testProblemCount();
        void testProblemCount_data();
        void testHintedTypes();
        void testHintedTypes_data();
        void testCleanupMultiplePasses();
        void testComments();
        void testComments_data();
        void testManyDeclarations();


    private:
        QList<KDevelop::TestFile*> createdFiles;
        QTemporaryDir testDirOwner;
        QDir testDir;
        QDir assetsDir;
        QString lastTest;
        
        QList<QString> FindPyFiles(QDir& root);
};

#endif // PYDUCHAINTEST_H