File: duchainbench.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 (46 lines) | stat: -rw-r--r-- 943 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
/*
    SPDX-FileCopyrightText: 2014 Benjamin Kaiser <benjaminjkaiser@gmail.com>

    SPDX-License-Identifier: MIT
*/

#ifndef PY_DUCHAINBENCH_H
#define PY_DUCHAINBENCH_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 DUChainBench : public QObject
{
    Q_OBJECT
public:
    explicit DUChainBench(QObject* parent = nullptr);
    void initShell();
    ~DUChainBench() override;

    KDevelop::ReferencedTopDUContext parse(const QString& code);

    Python::CodeAst::Ptr m_ast;

private Q_SLOTS:
    void benchSimpleStatements();
    void benchSimpleStatements_data();

private:
    QList<KDevelop::TestFile*> createdFiles;
    QDir testDir;
    QTemporaryDir testDirOwner;
};

#endif // DUCHAINBENCH_H