forked from qt-creator/qt-creator
AutoTest: Allow framework specific tool tip on settings
The grouping checkbox enables grouping, but frameworks can have more grouping modes than the default implementation. Allow frameworks to provide its own tool tip for the checkbox on the general settings page. Change-Id: I0515e542284491a669ef33820104a32074ecf885 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -81,6 +81,13 @@ QString GTestFramework::currentGTestFilter()
|
|||||||
return gSettings.isNull() ? QString("*.*") : gSettings->gtestFilter;
|
return gSettings.isNull() ? QString("*.*") : gSettings->gtestFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString GTestFramework::groupingToolTip() const
|
||||||
|
{
|
||||||
|
return QCoreApplication::translate("GTestFramework",
|
||||||
|
"Enable or disable grouping of test cases by folder or "
|
||||||
|
"gtest filter.\nSee also Google Test settings.");
|
||||||
|
}
|
||||||
|
|
||||||
GTest::Constants::GroupMode GTestFramework::groupMode()
|
GTest::Constants::GroupMode GTestFramework::groupMode()
|
||||||
{
|
{
|
||||||
static const Core::Id id
|
static const Core::Id id
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ public:
|
|||||||
bool hasFrameworkSettings() const override;
|
bool hasFrameworkSettings() const override;
|
||||||
static GTest::Constants::GroupMode groupMode();
|
static GTest::Constants::GroupMode groupMode();
|
||||||
static QString currentGTestFilter();
|
static QString currentGTestFilter();
|
||||||
|
QString groupingToolTip() const override;
|
||||||
protected:
|
protected:
|
||||||
ITestParser *createTestParser() const override;
|
ITestParser *createTestParser() const override;
|
||||||
TestTreeItem *createRootNode() const override;
|
TestTreeItem *createRootNode() const override;
|
||||||
|
|||||||
@@ -71,7 +71,8 @@ public:
|
|||||||
void setActive(bool active) { m_active = active; }
|
void setActive(bool active) { m_active = active; }
|
||||||
bool grouping() const { return m_grouping; }
|
bool grouping() const { return m_grouping; }
|
||||||
void setGrouping(bool group) { m_grouping = group; }
|
void setGrouping(bool group) { m_grouping = group; }
|
||||||
|
// framework specific tool tip to be displayed on the general settings page
|
||||||
|
virtual QString groupingToolTip() const { return QString(); }
|
||||||
protected:
|
protected:
|
||||||
virtual ITestParser *createTestParser() const = 0;
|
virtual ITestParser *createTestParser() const = 0;
|
||||||
virtual TestTreeItem *createRootNode() const = 0;
|
virtual TestTreeItem *createRootNode() const = 0;
|
||||||
|
|||||||
@@ -194,6 +194,13 @@ void TestFrameworkManager::setGroupingEnabledFor(const Core::Id &frameworkId, bo
|
|||||||
framework->setGrouping(enabled);
|
framework->setGrouping(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString TestFrameworkManager::groupingToolTip(const Core::Id &frameworkId) const
|
||||||
|
{
|
||||||
|
if (ITestFramework *framework = m_registeredFrameworks.value(frameworkId))
|
||||||
|
return framework->groupingToolTip();
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
bool TestFrameworkManager::hasActiveFrameworks() const
|
bool TestFrameworkManager::hasActiveFrameworks() const
|
||||||
{
|
{
|
||||||
for (ITestFramework *framework : m_registeredFrameworks.values()) {
|
for (ITestFramework *framework : m_registeredFrameworks.values()) {
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ public:
|
|||||||
bool isActive(const Core::Id &frameworkId) const;
|
bool isActive(const Core::Id &frameworkId) const;
|
||||||
bool groupingEnabled(const Core::Id &frameworkId) const;
|
bool groupingEnabled(const Core::Id &frameworkId) const;
|
||||||
void setGroupingEnabledFor(const Core::Id &frameworkId, bool enabled);
|
void setGroupingEnabledFor(const Core::Id &frameworkId, bool enabled);
|
||||||
|
QString groupingToolTip(const Core::Id &frameworkId) const;
|
||||||
bool hasActiveFrameworks() const;
|
bool hasActiveFrameworks() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -184,7 +184,10 @@ void TestSettingsWidget::populateFrameworksListWidget(const QHash<Core::Id, bool
|
|||||||
: Qt::Unchecked);
|
: Qt::Unchecked);
|
||||||
item->setToolTip(0, tr("Enable or disable test frameworks to be handled by the AutoTest "
|
item->setToolTip(0, tr("Enable or disable test frameworks to be handled by the AutoTest "
|
||||||
"plugin."));
|
"plugin."));
|
||||||
item->setToolTip(1, tr("Enable or disable grouping of test cases by folder."));
|
QString toolTip = frameworkManager->groupingToolTip(id);
|
||||||
|
if (toolTip.isEmpty())
|
||||||
|
toolTip = tr("Enable or disable grouping of test cases by folder.");
|
||||||
|
item->setToolTip(1, toolTip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user