File indexing completed on 2024-05-12 04:39:14

0001 /*
0002     SPDX-FileCopyrightText: 2014 David Stevens <dgedstevens@gmail.com>
0003     SPDX-FileCopyrightText: 2014 Kevin Funk <kfunk@kde.org>
0004     SPDX-FileCopyrightText: 2016 Milian Wolff <mail@milianw.de>
0005 
0006     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0007 */
0008 
0009 #ifndef CODECOMPLETIONTESTBASE_H
0010 #define CODECOMPLETIONTESTBASE_H
0011 
0012 #include <QObject>
0013 
0014 #include <memory>
0015 
0016 namespace KTextEditor {
0017 class View;
0018 }
0019 
0020 namespace KDevelop
0021 {
0022 class TestProjectController;
0023 }
0024 
0025 struct DeleteDocument
0026 {
0027     void operator()(KTextEditor::View* view) const;
0028 };
0029 
0030 class CodeCompletionTestBase : public QObject
0031 {
0032     Q_OBJECT
0033 
0034 public:
0035     std::unique_ptr<KTextEditor::View, DeleteDocument> createView(const QUrl& url) const;
0036 
0037 private Q_SLOTS:
0038     void initTestCase();
0039     void cleanupTestCase();
0040     void init();
0041 
0042 protected:
0043     KDevelop::TestProjectController* m_projectController;
0044 };
0045 
0046 #endif // CODECOMPLETIONTESTBASE_H