2016-05-11 13:02:42 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "../itestparser.h"
|
|
|
|
|
|
2021-01-01 19:19:10 +01:00
|
|
|
#include "qttesttreeitem.h"
|
|
|
|
|
|
|
|
|
|
namespace CppTools { class CppModelManager; }
|
|
|
|
|
|
2016-05-11 13:02:42 +02:00
|
|
|
namespace Autotest {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class QtTestParseResult : public TestParseResult
|
|
|
|
|
{
|
|
|
|
|
public:
|
2020-10-06 15:27:27 +02:00
|
|
|
explicit QtTestParseResult(ITestBase *base) : TestParseResult(base) {}
|
2017-01-04 12:06:46 +01:00
|
|
|
void setInherited(bool inherited) { m_inherited = inherited; }
|
|
|
|
|
bool inherited() const { return m_inherited; }
|
2016-05-11 13:02:42 +02:00
|
|
|
TestTreeItem *createTestTreeItem() const override;
|
2017-01-04 12:06:46 +01:00
|
|
|
private:
|
|
|
|
|
bool m_inherited = false;
|
2016-05-11 13:02:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class QtTestParser : public CppParser
|
|
|
|
|
{
|
|
|
|
|
public:
|
2020-03-13 13:54:33 +01:00
|
|
|
explicit QtTestParser(ITestFramework *framework) : CppParser(framework) {}
|
|
|
|
|
|
2018-01-08 15:14:33 +01:00
|
|
|
void init(const QStringList &filesToParse, bool fullParse) override;
|
2016-07-12 10:35:43 +02:00
|
|
|
void release() override;
|
2016-05-11 13:02:42 +02:00
|
|
|
bool processDocument(QFutureInterface<TestParseResultPtr> futureInterface,
|
|
|
|
|
const QString &fileName) override;
|
|
|
|
|
|
|
|
|
|
private:
|
2021-01-01 19:19:10 +01:00
|
|
|
QString testClass(const CppTools::CppModelManager *modelManager, const QString &fileName) const;
|
|
|
|
|
QHash<QString, QtTestCodeLocationList> checkForDataTags(const QString &fileName) const;
|
2016-05-11 13:02:42 +02:00
|
|
|
QHash<QString, QString> m_testCaseNames;
|
2017-01-04 13:56:20 +01:00
|
|
|
QMultiHash<QString, QString> m_alternativeFiles;
|
2016-05-11 13:02:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Autotest
|