2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2016-06-01 16:22:50 +02:00
|
|
|
|
|
|
|
|
#include "qttestframework.h"
|
2022-07-13 18:31:56 +02:00
|
|
|
|
2016-10-05 12:39:23 +02:00
|
|
|
#include "qttestconstants.h"
|
2016-06-01 16:22:50 +02:00
|
|
|
#include "qttestparser.h"
|
|
|
|
|
#include "qttesttreeitem.h"
|
2022-07-13 18:31:56 +02:00
|
|
|
#include "../autotesttr.h"
|
2016-06-01 16:22:50 +02:00
|
|
|
|
|
|
|
|
namespace Autotest {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2020-03-13 13:54:33 +01:00
|
|
|
ITestParser *QtTestFramework::createTestParser()
|
2016-06-01 16:22:50 +02:00
|
|
|
{
|
2020-03-13 13:54:33 +01:00
|
|
|
return new QtTestParser(this);
|
2016-06-01 16:22:50 +02:00
|
|
|
}
|
|
|
|
|
|
2020-10-19 13:56:19 +02:00
|
|
|
ITestTreeItem *QtTestFramework::createRootNode()
|
2016-06-01 16:22:50 +02:00
|
|
|
{
|
2023-01-14 16:25:51 +01:00
|
|
|
return new QtTestTreeItem(this, displayName(), {}, ITestTreeItem::Root);
|
2016-10-05 12:39:23 +02:00
|
|
|
}
|
|
|
|
|
|
2016-06-01 16:22:50 +02:00
|
|
|
const char *QtTestFramework::name() const
|
|
|
|
|
{
|
2016-10-05 12:39:23 +02:00
|
|
|
return QtTest::Constants::FRAMEWORK_NAME;
|
2016-06-01 16:22:50 +02:00
|
|
|
}
|
|
|
|
|
|
2022-06-09 15:02:30 +02:00
|
|
|
QString QtTestFramework::displayName() const
|
|
|
|
|
{
|
2022-07-13 18:31:56 +02:00
|
|
|
return Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY);
|
2022-06-09 15:02:30 +02:00
|
|
|
}
|
|
|
|
|
|
2016-06-01 16:22:50 +02:00
|
|
|
unsigned QtTestFramework::priority() const
|
|
|
|
|
{
|
2016-10-05 12:39:23 +02:00
|
|
|
return QtTest::Constants::FRAMEWORK_PRIORITY;
|
2016-06-01 16:22:50 +02:00
|
|
|
}
|
|
|
|
|
|
2023-02-06 16:25:50 +01:00
|
|
|
QStringList QtTestFramework::testNameForSymbolName(const QString &symbolName) const
|
|
|
|
|
{
|
|
|
|
|
int index = symbolName.lastIndexOf("::");
|
|
|
|
|
if (index == -1)
|
|
|
|
|
return {};
|
|
|
|
|
return { symbolName.left(index), symbolName.mid(index + 2) };
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-01 16:22:50 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Autotest
|