forked from qt-creator/qt-creator
AutoTest: Move framework settings into framework manager
Change-Id: I9914291adb102de5136802eb3b6d12afb6276538 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -80,6 +80,7 @@ HEADERS += \
|
|||||||
gtest/gtestvisitors.h \
|
gtest/gtestvisitors.h \
|
||||||
gtest/gtestframework.h \
|
gtest/gtestframework.h \
|
||||||
gtest/gtestsettings.h \
|
gtest/gtestsettings.h \
|
||||||
|
gtest/gtestconstants.h \
|
||||||
qtest/qttesttreeitem.h \
|
qtest/qttesttreeitem.h \
|
||||||
qtest/qttest_utils.h \
|
qtest/qttest_utils.h \
|
||||||
qtest/qttestresult.h \
|
qtest/qttestresult.h \
|
||||||
@@ -89,6 +90,7 @@ HEADERS += \
|
|||||||
qtest/qttestparser.h \
|
qtest/qttestparser.h \
|
||||||
qtest/qttestframework.h \
|
qtest/qttestframework.h \
|
||||||
qtest/qttestsettings.h \
|
qtest/qttestsettings.h \
|
||||||
|
qtest/qttestconstants.h \
|
||||||
quick/quicktestconfiguration.h \
|
quick/quicktestconfiguration.h \
|
||||||
quick/quicktestparser.h \
|
quick/quicktestparser.h \
|
||||||
quick/quicktesttreeitem.h \
|
quick/quicktesttreeitem.h \
|
||||||
|
@@ -41,5 +41,7 @@ const char TASK_PARSE[] = "AutoTest.Task.Parse";
|
|||||||
const char AUTOTEST_SETTINGS_CATEGORY[] = "ZY.Tests";
|
const char AUTOTEST_SETTINGS_CATEGORY[] = "ZY.Tests";
|
||||||
const char FRAMEWORK_PREFIX[] = "AutoTest.Framework.";
|
const char FRAMEWORK_PREFIX[] = "AutoTest.Framework.";
|
||||||
|
|
||||||
|
|
||||||
|
const char SETTINGSGROUP[] = "Autotest";
|
||||||
} // namespace Constants
|
} // namespace Constants
|
||||||
} // namespace Autotest
|
} // namespace Autotest
|
||||||
|
@@ -135,7 +135,7 @@ bool AutotestPlugin::initialize(const QStringList &arguments, QString *errorStri
|
|||||||
m_frameworkManager->registerTestFramework(new QuickTestFramework);
|
m_frameworkManager->registerTestFramework(new QuickTestFramework);
|
||||||
m_frameworkManager->registerTestFramework(new GTestFramework);
|
m_frameworkManager->registerTestFramework(new GTestFramework);
|
||||||
|
|
||||||
m_settings->fromSettings(ICore::settings());
|
m_frameworkManager->synchronizeSettings(ICore::settings());
|
||||||
addAutoReleasedObject(new TestSettingsPage(m_settings));
|
addAutoReleasedObject(new TestSettingsPage(m_settings));
|
||||||
addAutoReleasedObject(new TestNavigationWidgetFactory);
|
addAutoReleasedObject(new TestNavigationWidgetFactory);
|
||||||
addAutoReleasedObject(TestResultsPane::instance());
|
addAutoReleasedObject(TestResultsPane::instance());
|
||||||
|
@@ -24,8 +24,10 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "gtestconfiguration.h"
|
#include "gtestconfiguration.h"
|
||||||
|
#include "gtestconstants.h"
|
||||||
#include "gtestoutputreader.h"
|
#include "gtestoutputreader.h"
|
||||||
#include "../testsettings.h"
|
#include "gtestsettings.h"
|
||||||
|
#include "../testframeworkmanager.h"
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -36,25 +38,32 @@ TestOutputReader *GTestConfiguration::outputReader(const QFutureInterface<TestRe
|
|||||||
return new GTestOutputReader(fi, app, buildDirectory());
|
return new GTestOutputReader(fi, app, buildDirectory());
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList GTestConfiguration::argumentsForTestRunner(const TestSettings &settings) const
|
QStringList GTestConfiguration::argumentsForTestRunner() const
|
||||||
{
|
{
|
||||||
|
static const Core::Id id
|
||||||
|
= Core::Id(Constants::FRAMEWORK_PREFIX).withSuffix(GTest::Constants::FRAMEWORK_NAME);
|
||||||
|
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
const QStringList &testSets = testCases();
|
const QStringList &testSets = testCases();
|
||||||
if (testSets.size())
|
if (testSets.size())
|
||||||
arguments << "--gtest_filter=" + testSets.join(':');
|
arguments << "--gtest_filter=" + testSets.join(':');
|
||||||
if (settings.gTestSettings.runDisabled)
|
|
||||||
|
TestFrameworkManager *manager = TestFrameworkManager::instance();
|
||||||
|
auto gSettings = qSharedPointerCast<GTestSettings>(manager->settingsForTestFramework(id));
|
||||||
|
if (gSettings.isNull())
|
||||||
|
return arguments;
|
||||||
|
|
||||||
|
if (gSettings->runDisabled)
|
||||||
arguments << "--gtest_also_run_disabled_tests";
|
arguments << "--gtest_also_run_disabled_tests";
|
||||||
if (settings.gTestSettings.repeat)
|
if (gSettings->repeat)
|
||||||
arguments << QString("--gtest_repeat=%1").arg(settings.gTestSettings.iterations);
|
arguments << QString("--gtest_repeat=%1").arg(gSettings->iterations);
|
||||||
if (settings.gTestSettings.shuffle) {
|
if (gSettings->shuffle)
|
||||||
arguments << "--gtest_shuffle"
|
arguments << "--gtest_shuffle" << QString("--gtest_random_seed=%1").arg(gSettings->seed);
|
||||||
<< QString("--gtest_random_seed=%1").arg(settings.gTestSettings.seed);
|
if (gSettings->throwOnFailure)
|
||||||
}
|
|
||||||
if (settings.gTestSettings.throwOnFailure)
|
|
||||||
arguments << "--gtest_throw_on_failure";
|
arguments << "--gtest_throw_on_failure";
|
||||||
|
|
||||||
if (runMode() == DebuggableTestConfiguration::Debug) {
|
if (runMode() == DebuggableTestConfiguration::Debug) {
|
||||||
if (settings.gTestSettings.breakOnFailure)
|
if (gSettings->breakOnFailure)
|
||||||
arguments << "--gtest_break_on_failure";
|
arguments << "--gtest_break_on_failure";
|
||||||
}
|
}
|
||||||
return arguments;
|
return arguments;
|
||||||
|
@@ -36,7 +36,7 @@ public:
|
|||||||
explicit GTestConfiguration() {}
|
explicit GTestConfiguration() {}
|
||||||
TestOutputReader *outputReader(const QFutureInterface<TestResultPtr> &fi,
|
TestOutputReader *outputReader(const QFutureInterface<TestResultPtr> &fi,
|
||||||
QProcess *app) const override;
|
QProcess *app) const override;
|
||||||
QStringList argumentsForTestRunner(const TestSettings &settings) const override;
|
QStringList argumentsForTestRunner() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
40
src/plugins/autotest/gtest/gtestconstants.h
Normal file
40
src/plugins/autotest/gtest/gtestconstants.h
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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 <QtGlobal>
|
||||||
|
|
||||||
|
namespace Autotest {
|
||||||
|
namespace GTest {
|
||||||
|
namespace Constants {
|
||||||
|
|
||||||
|
const char FRAMEWORK_NAME[] = "GTest";
|
||||||
|
const char FRAMEWORK_SETTINGS_CATEGORY[] = QT_TRANSLATE_NOOP("GTestFramework", "Google Test");
|
||||||
|
const unsigned FRAMEWORK_PRIORITY = 10;
|
||||||
|
|
||||||
|
} // namespace Constants
|
||||||
|
} // namespace GTest
|
||||||
|
} // namespace AutoTest
|
@@ -24,6 +24,8 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "gtestframework.h"
|
#include "gtestframework.h"
|
||||||
|
#include "gtestconstants.h"
|
||||||
|
#include "gtestsettings.h"
|
||||||
#include "gtesttreeitem.h"
|
#include "gtesttreeitem.h"
|
||||||
#include "gtestparser.h"
|
#include "gtestparser.h"
|
||||||
|
|
||||||
@@ -37,18 +39,30 @@ ITestParser *GTestFramework::createTestParser() const
|
|||||||
|
|
||||||
TestTreeItem *GTestFramework::createRootNode() const
|
TestTreeItem *GTestFramework::createRootNode() const
|
||||||
{
|
{
|
||||||
return new GTestTreeItem(QCoreApplication::translate("GTestFramework", "Google Tests"),
|
return new GTestTreeItem(
|
||||||
QString(), TestTreeItem::Root);
|
QCoreApplication::translate("GTestFramework",
|
||||||
|
GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY),
|
||||||
|
QString(), TestTreeItem::Root);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *GTestFramework::name() const
|
const char *GTestFramework::name() const
|
||||||
{
|
{
|
||||||
return "GTest";
|
return GTest::Constants::FRAMEWORK_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned GTestFramework::priority() const
|
unsigned GTestFramework::priority() const
|
||||||
{
|
{
|
||||||
return 10;
|
return GTest::Constants::FRAMEWORK_PRIORITY;
|
||||||
|
}
|
||||||
|
|
||||||
|
IFrameworkSettings *GTestFramework::createFrameworkSettings() const
|
||||||
|
{
|
||||||
|
return new GTestSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GTestFramework::hasFrameworkSettings() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -36,6 +36,8 @@ public:
|
|||||||
GTestFramework() : ITestFramework(true) {}
|
GTestFramework() : ITestFramework(true) {}
|
||||||
const char *name() const override;
|
const char *name() const override;
|
||||||
unsigned priority() const override;
|
unsigned priority() const override;
|
||||||
|
IFrameworkSettings *createFrameworkSettings() const override;
|
||||||
|
bool hasFrameworkSettings() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ITestParser *createTestParser() const override;
|
ITestParser *createTestParser() const override;
|
||||||
|
@@ -31,6 +31,8 @@
|
|||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
class IFrameworkSettings;
|
||||||
|
|
||||||
class ITestFramework
|
class ITestFramework
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -43,6 +45,8 @@ public:
|
|||||||
|
|
||||||
virtual const char *name() const = 0;
|
virtual const char *name() const = 0;
|
||||||
virtual unsigned priority() const = 0; // should this be modifyable?
|
virtual unsigned priority() const = 0; // should this be modifyable?
|
||||||
|
virtual bool hasFrameworkSettings() const { return false; }
|
||||||
|
virtual IFrameworkSettings *createFrameworkSettings() const { return 0; }
|
||||||
|
|
||||||
TestTreeItem *rootNode()
|
TestTreeItem *rootNode()
|
||||||
{ if (!m_rootNode)
|
{ if (!m_rootNode)
|
||||||
|
@@ -24,8 +24,10 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qttestconfiguration.h"
|
#include "qttestconfiguration.h"
|
||||||
|
#include "qttestconstants.h"
|
||||||
#include "qttestoutputreader.h"
|
#include "qttestoutputreader.h"
|
||||||
#include "../testsettings.h"
|
#include "qttestsettings.h"
|
||||||
|
#include "../testframeworkmanager.h"
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -36,19 +38,26 @@ TestOutputReader *QtTestConfiguration::outputReader(const QFutureInterface<TestR
|
|||||||
return new QtTestOutputReader(fi, app, buildDirectory());
|
return new QtTestOutputReader(fi, app, buildDirectory());
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QtTestConfiguration::argumentsForTestRunner(const TestSettings &settings) const
|
QStringList QtTestConfiguration::argumentsForTestRunner() const
|
||||||
{
|
{
|
||||||
QStringList arguments("-xml");
|
static const Core::Id id
|
||||||
|
= Core::Id(Constants::FRAMEWORK_PREFIX).withSuffix(QtTest::Constants::FRAMEWORK_NAME);
|
||||||
|
|
||||||
const QString &metricsOption
|
QStringList arguments("-xml");
|
||||||
= QtTestSettings::metricsTypeToOption(settings.qtTestSettings.metrics);
|
|
||||||
if (!metricsOption.isEmpty())
|
|
||||||
arguments << metricsOption;
|
|
||||||
if (testCases().count())
|
if (testCases().count())
|
||||||
arguments << testCases();
|
arguments << testCases();
|
||||||
|
|
||||||
|
TestFrameworkManager *manager = TestFrameworkManager::instance();
|
||||||
|
auto qtSettings = qSharedPointerCast<QtTestSettings>(manager->settingsForTestFramework(id));
|
||||||
|
if (qtSettings.isNull())
|
||||||
|
return arguments;
|
||||||
|
|
||||||
|
const QString &metricsOption = QtTestSettings::metricsTypeToOption(qtSettings->metrics);
|
||||||
|
if (!metricsOption.isEmpty())
|
||||||
|
arguments << metricsOption;
|
||||||
|
|
||||||
if (runMode() == DebuggableTestConfiguration::Debug) {
|
if (runMode() == DebuggableTestConfiguration::Debug) {
|
||||||
if (settings.qtTestSettings.noCrashHandler)
|
if (qtSettings->noCrashHandler)
|
||||||
arguments << "-nocrashhandler";
|
arguments << "-nocrashhandler";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@ public:
|
|||||||
explicit QtTestConfiguration() {}
|
explicit QtTestConfiguration() {}
|
||||||
TestOutputReader *outputReader(const QFutureInterface<TestResultPtr> &fi,
|
TestOutputReader *outputReader(const QFutureInterface<TestResultPtr> &fi,
|
||||||
QProcess *app) const override;
|
QProcess *app) const override;
|
||||||
QStringList argumentsForTestRunner(const TestSettings &settings) const override;
|
QStringList argumentsForTestRunner() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
40
src/plugins/autotest/qtest/qttestconstants.h
Normal file
40
src/plugins/autotest/qtest/qttestconstants.h
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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 <QtGlobal>
|
||||||
|
|
||||||
|
namespace Autotest {
|
||||||
|
namespace QtTest {
|
||||||
|
namespace Constants {
|
||||||
|
|
||||||
|
const char FRAMEWORK_NAME[] = "QtTest";
|
||||||
|
const char FRAMEWORK_SETTINGS_CATEGORY[] = QT_TRANSLATE_NOOP("QtTestFramework", "Qt Test");
|
||||||
|
const unsigned FRAMEWORK_PRIORITY = 1;
|
||||||
|
|
||||||
|
} // namespace Constants
|
||||||
|
} // namespace QtTest
|
||||||
|
} // namespace Autotest
|
@@ -24,7 +24,9 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qttestframework.h"
|
#include "qttestframework.h"
|
||||||
|
#include "qttestconstants.h"
|
||||||
#include "qttestparser.h"
|
#include "qttestparser.h"
|
||||||
|
#include "qttestsettings.h"
|
||||||
#include "qttesttreeitem.h"
|
#include "qttesttreeitem.h"
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
@@ -37,18 +39,30 @@ ITestParser *QtTestFramework::createTestParser() const
|
|||||||
|
|
||||||
TestTreeItem *QtTestFramework::createRootNode() const
|
TestTreeItem *QtTestFramework::createRootNode() const
|
||||||
{
|
{
|
||||||
return new QtTestTreeItem(QCoreApplication::translate("QtTestFramework", "Qt Tests"),
|
return new QtTestTreeItem(
|
||||||
QString(), TestTreeItem::Root);
|
QCoreApplication::translate("QtTestFramework",
|
||||||
|
QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY),
|
||||||
|
QString(), TestTreeItem::Root);
|
||||||
|
}
|
||||||
|
|
||||||
|
IFrameworkSettings *QtTestFramework::createFrameworkSettings() const
|
||||||
|
{
|
||||||
|
return new QtTestSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QtTestFramework::hasFrameworkSettings() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *QtTestFramework::name() const
|
const char *QtTestFramework::name() const
|
||||||
{
|
{
|
||||||
return "QtTest";
|
return QtTest::Constants::FRAMEWORK_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned QtTestFramework::priority() const
|
unsigned QtTestFramework::priority() const
|
||||||
{
|
{
|
||||||
return 1;
|
return QtTest::Constants::FRAMEWORK_PRIORITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -36,6 +36,8 @@ public:
|
|||||||
QtTestFramework() : ITestFramework(true) {}
|
QtTestFramework() : ITestFramework(true) {}
|
||||||
const char *name() const override;
|
const char *name() const override;
|
||||||
unsigned priority() const override;
|
unsigned priority() const override;
|
||||||
|
IFrameworkSettings *createFrameworkSettings() const override;
|
||||||
|
bool hasFrameworkSettings() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ITestParser *createTestParser() const override;
|
ITestParser *createTestParser() const override;
|
||||||
|
@@ -24,8 +24,10 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "quicktestconfiguration.h"
|
#include "quicktestconfiguration.h"
|
||||||
|
#include "../qtest/qttestconstants.h"
|
||||||
#include "../qtest/qttestoutputreader.h"
|
#include "../qtest/qttestoutputreader.h"
|
||||||
#include "../testsettings.h"
|
#include "../qtest/qttestsettings.h"
|
||||||
|
#include "../testframeworkmanager.h"
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -36,16 +38,23 @@ TestOutputReader *QuickTestConfiguration::outputReader(const QFutureInterface<Te
|
|||||||
return new QtTestOutputReader(fi, app, buildDirectory());
|
return new QtTestOutputReader(fi, app, buildDirectory());
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QuickTestConfiguration::argumentsForTestRunner(const TestSettings &settings) const
|
QStringList QuickTestConfiguration::argumentsForTestRunner() const
|
||||||
{
|
{
|
||||||
QStringList arguments({"-xml"});
|
static const Core::Id id
|
||||||
|
= Core::Id(Constants::FRAMEWORK_PREFIX).withSuffix(QtTest::Constants::FRAMEWORK_NAME);
|
||||||
|
|
||||||
const QString &metricsOption
|
QStringList arguments("-xml");
|
||||||
= QtTestSettings::metricsTypeToOption(settings.qtTestSettings.metrics);
|
|
||||||
if (!metricsOption.isEmpty())
|
|
||||||
arguments << metricsOption;
|
|
||||||
if (testCases().count())
|
if (testCases().count())
|
||||||
arguments << testCases();
|
arguments << testCases();
|
||||||
|
|
||||||
|
TestFrameworkManager *manager = TestFrameworkManager::instance();
|
||||||
|
auto qtSettings = qSharedPointerCast<QtTestSettings>(manager->settingsForTestFramework(id));
|
||||||
|
if (qtSettings.isNull())
|
||||||
|
return arguments;
|
||||||
|
|
||||||
|
const QString &metricsOption = QtTestSettings::metricsTypeToOption(qtSettings->metrics);
|
||||||
|
if (!metricsOption.isEmpty())
|
||||||
|
arguments << metricsOption;
|
||||||
return arguments;
|
return arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@ public:
|
|||||||
explicit QuickTestConfiguration() {}
|
explicit QuickTestConfiguration() {}
|
||||||
TestOutputReader *outputReader(const QFutureInterface<TestResultPtr> &fi,
|
TestOutputReader *outputReader(const QFutureInterface<TestResultPtr> &fi,
|
||||||
QProcess *app) const override;
|
QProcess *app) const override;
|
||||||
QStringList argumentsForTestRunner(const TestSettings &settings) const override;
|
QStringList argumentsForTestRunner() const override;
|
||||||
|
|
||||||
void setUnnamedOnly(bool unnamedOnly);
|
void setUnnamedOnly(bool unnamedOnly);
|
||||||
bool unnamedOnly() const { return m_unnamedOnly; }
|
bool unnamedOnly() const { return m_unnamedOnly; }
|
||||||
|
@@ -27,7 +27,6 @@
|
|||||||
#include "testoutputreader.h"
|
#include "testoutputreader.h"
|
||||||
#include "testrunconfiguration.h"
|
#include "testrunconfiguration.h"
|
||||||
#include "testrunner.h"
|
#include "testrunner.h"
|
||||||
#include "testsettings.h"
|
|
||||||
|
|
||||||
#include <cpptools/cppmodelmanager.h>
|
#include <cpptools/cppmodelmanager.h>
|
||||||
#include <cpptools/projectinfo.h>
|
#include <cpptools/projectinfo.h>
|
||||||
|
@@ -45,7 +45,6 @@ namespace Internal {
|
|||||||
class TestOutputReader;
|
class TestOutputReader;
|
||||||
class TestResult;
|
class TestResult;
|
||||||
class TestRunConfiguration;
|
class TestRunConfiguration;
|
||||||
struct TestSettings;
|
|
||||||
|
|
||||||
using TestResultPtr = QSharedPointer<TestResult>;
|
using TestResultPtr = QSharedPointer<TestResult>;
|
||||||
|
|
||||||
@@ -86,7 +85,7 @@ public:
|
|||||||
|
|
||||||
virtual TestOutputReader *outputReader(const QFutureInterface<TestResultPtr> &fi,
|
virtual TestOutputReader *outputReader(const QFutureInterface<TestResultPtr> &fi,
|
||||||
QProcess *app) const = 0;
|
QProcess *app) const = 0;
|
||||||
virtual QStringList argumentsForTestRunner(const TestSettings &settings) const = 0;
|
virtual QStringList argumentsForTestRunner() const = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QStringList m_testCases;
|
QStringList m_testCases;
|
||||||
|
@@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
#include "testframeworkmanager.h"
|
#include "testframeworkmanager.h"
|
||||||
#include "autotestconstants.h"
|
#include "autotestconstants.h"
|
||||||
|
#include "autotestplugin.h"
|
||||||
|
#include "iframeworksettings.h"
|
||||||
#include "itestframework.h"
|
#include "itestframework.h"
|
||||||
#include "itestparser.h"
|
#include "itestparser.h"
|
||||||
#include "testrunner.h"
|
#include "testrunner.h"
|
||||||
@@ -74,6 +76,11 @@ bool TestFrameworkManager::registerTestFramework(ITestFramework *framework)
|
|||||||
// TODO check for unique priority before registering
|
// TODO check for unique priority before registering
|
||||||
qCDebug(LOG) << "Registering" << id;
|
qCDebug(LOG) << "Registering" << id;
|
||||||
m_registeredFrameworks.insert(id, framework);
|
m_registeredFrameworks.insert(id, framework);
|
||||||
|
|
||||||
|
if (framework->hasFrameworkSettings()) {
|
||||||
|
QSharedPointer<IFrameworkSettings> frameworkSettings(framework->createFrameworkSettings());
|
||||||
|
m_frameworkSettings.insert(id, frameworkSettings);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,6 +152,23 @@ ITestParser *TestFrameworkManager::testParserForTestFramework(const Core::Id &fr
|
|||||||
return testParser;
|
return testParser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSharedPointer<IFrameworkSettings> TestFrameworkManager::settingsForTestFramework(
|
||||||
|
const Core::Id &frameworkId) const
|
||||||
|
{
|
||||||
|
return m_frameworkSettings.contains(frameworkId) ? m_frameworkSettings.value(frameworkId)
|
||||||
|
: QSharedPointer<IFrameworkSettings>();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TestFrameworkManager::synchronizeSettings(QSettings *s)
|
||||||
|
{
|
||||||
|
AutotestPlugin::instance()->settings()->fromSettings(s);
|
||||||
|
for (const Core::Id &id : m_frameworkSettings.keys()) {
|
||||||
|
QSharedPointer<IFrameworkSettings> fSettings = settingsForTestFramework(id);
|
||||||
|
if (!fSettings.isNull())
|
||||||
|
fSettings->fromSettings(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool TestFrameworkManager::isActive(const Core::Id &frameworkId) const
|
bool TestFrameworkManager::isActive(const Core::Id &frameworkId) const
|
||||||
{
|
{
|
||||||
ITestFramework *framework = m_registeredFrameworks.value(frameworkId);
|
ITestFramework *framework = m_registeredFrameworks.value(frameworkId);
|
||||||
|
@@ -28,11 +28,16 @@
|
|||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QSettings;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Core { class Id; }
|
namespace Core { class Id; }
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
class IFrameworkSettings;
|
||||||
class ITestFramework;
|
class ITestFramework;
|
||||||
class ITestParser;
|
class ITestParser;
|
||||||
class TestRunner;
|
class TestRunner;
|
||||||
@@ -55,6 +60,8 @@ public:
|
|||||||
|
|
||||||
TestTreeItem *rootNodeForTestFramework(const Core::Id &frameworkId) const;
|
TestTreeItem *rootNodeForTestFramework(const Core::Id &frameworkId) const;
|
||||||
ITestParser *testParserForTestFramework(const Core::Id &frameworkId) const;
|
ITestParser *testParserForTestFramework(const Core::Id &frameworkId) const;
|
||||||
|
QSharedPointer<IFrameworkSettings> settingsForTestFramework(const Core::Id &frameworkId) const;
|
||||||
|
void synchronizeSettings(QSettings *s);
|
||||||
bool isActive(const Core::Id &frameworkId) const;
|
bool isActive(const Core::Id &frameworkId) const;
|
||||||
bool hasActiveFrameworks() const;
|
bool hasActiveFrameworks() const;
|
||||||
|
|
||||||
@@ -62,6 +69,7 @@ private:
|
|||||||
QVector<Core::Id> activeFrameworkIds() const;
|
QVector<Core::Id> activeFrameworkIds() const;
|
||||||
explicit TestFrameworkManager();
|
explicit TestFrameworkManager();
|
||||||
QHash<Core::Id, ITestFramework *> m_registeredFrameworks;
|
QHash<Core::Id, ITestFramework *> m_registeredFrameworks;
|
||||||
|
QHash<Core::Id, QSharedPointer<IFrameworkSettings> > m_frameworkSettings;
|
||||||
TestTreeModel *m_testTreeModel;
|
TestTreeModel *m_testTreeModel;
|
||||||
TestRunner *m_testRunner;
|
TestRunner *m_testRunner;
|
||||||
|
|
||||||
|
@@ -64,8 +64,7 @@ public:
|
|||||||
ProjectExplorer::StandardRunnable r;
|
ProjectExplorer::StandardRunnable r;
|
||||||
QTC_ASSERT(m_testConfig, return r);
|
QTC_ASSERT(m_testConfig, return r);
|
||||||
r.executable = m_testConfig->targetFile();
|
r.executable = m_testConfig->targetFile();
|
||||||
r.commandLineArguments = m_testConfig->argumentsForTestRunner(
|
r.commandLineArguments = m_testConfig->argumentsForTestRunner().join(' ');
|
||||||
*AutotestPlugin::instance()->settings()).join(' ');
|
|
||||||
r.workingDirectory = m_testConfig->workingDirectory();
|
r.workingDirectory = m_testConfig->workingDirectory();
|
||||||
r.environment = m_testConfig->environment();
|
r.environment = m_testConfig->environment();
|
||||||
r.runMode = ProjectExplorer::ApplicationLauncher::Gui;
|
r.runMode = ProjectExplorer::ApplicationLauncher::Gui;
|
||||||
|
@@ -138,7 +138,7 @@ static void performTestRun(QFutureInterface<TestResultPtr> &futureInterface,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
testProcess.setArguments(testConfiguration->argumentsForTestRunner(settings));
|
testProcess.setArguments(testConfiguration->argumentsForTestRunner());
|
||||||
testProcess.setWorkingDirectory(testConfiguration->workingDirectory());
|
testProcess.setWorkingDirectory(testConfiguration->workingDirectory());
|
||||||
if (Utils::HostOsInfo::isWindowsHost())
|
if (Utils::HostOsInfo::isWindowsHost())
|
||||||
environment.insert("QT_LOGGING_TO_CONSOLE", "1");
|
environment.insert("QT_LOGGING_TO_CONSOLE", "1");
|
||||||
@@ -304,8 +304,7 @@ void TestRunner::debugTests()
|
|||||||
|
|
||||||
Debugger::DebuggerStartParameters sp;
|
Debugger::DebuggerStartParameters sp;
|
||||||
sp.inferior.executable = commandFilePath;
|
sp.inferior.executable = commandFilePath;
|
||||||
sp.inferior.commandLineArguments = config->argumentsForTestRunner(
|
sp.inferior.commandLineArguments = config->argumentsForTestRunner().join(' ');
|
||||||
*AutotestPlugin::instance()->settings()).join(' ');
|
|
||||||
sp.inferior.environment = config->environment();
|
sp.inferior.environment = config->environment();
|
||||||
sp.inferior.workingDirectory = config->workingDirectory();
|
sp.inferior.workingDirectory = config->workingDirectory();
|
||||||
sp.displayName = config->displayName();
|
sp.displayName = config->displayName();
|
||||||
|
@@ -24,6 +24,8 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "testsettings.h"
|
#include "testsettings.h"
|
||||||
|
#include "autotestconstants.h"
|
||||||
|
#include "iframeworksettings.h"
|
||||||
#include "testframeworkmanager.h"
|
#include "testframeworkmanager.h"
|
||||||
|
|
||||||
#include <coreplugin/id.h>
|
#include <coreplugin/id.h>
|
||||||
@@ -33,7 +35,6 @@
|
|||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
static const char group[] = "Autotest";
|
|
||||||
static const char timeoutKey[] = "Timeout";
|
static const char timeoutKey[] = "Timeout";
|
||||||
static const char omitInternalKey[] = "OmitInternal";
|
static const char omitInternalKey[] = "OmitInternal";
|
||||||
static const char omitRunConfigWarnKey[] = "OmitRCWarnings";
|
static const char omitRunConfigWarnKey[] = "OmitRCWarnings";
|
||||||
@@ -50,7 +51,7 @@ TestSettings::TestSettings()
|
|||||||
|
|
||||||
void TestSettings::toSettings(QSettings *s) const
|
void TestSettings::toSettings(QSettings *s) const
|
||||||
{
|
{
|
||||||
s->beginGroup(group);
|
s->beginGroup(Constants::SETTINGSGROUP);
|
||||||
s->setValue(timeoutKey, timeout);
|
s->setValue(timeoutKey, timeout);
|
||||||
s->setValue(omitInternalKey, omitInternalMssg);
|
s->setValue(omitInternalKey, omitInternalMssg);
|
||||||
s->setValue(omitRunConfigWarnKey, omitRunConfigWarn);
|
s->setValue(omitRunConfigWarnKey, omitRunConfigWarn);
|
||||||
@@ -60,20 +61,19 @@ void TestSettings::toSettings(QSettings *s) const
|
|||||||
// store frameworks and their current active state
|
// store frameworks and their current active state
|
||||||
for (const Core::Id &id : frameworks.keys())
|
for (const Core::Id &id : frameworks.keys())
|
||||||
s->setValue(QLatin1String(id.name()), frameworks.value(id));
|
s->setValue(QLatin1String(id.name()), frameworks.value(id));
|
||||||
|
|
||||||
s->beginGroup(qtTestSettings.name());
|
|
||||||
qtTestSettings.toSettings(s);
|
|
||||||
s->endGroup();
|
|
||||||
s->beginGroup(gTestSettings.name());
|
|
||||||
gTestSettings.toSettings(s);
|
|
||||||
s->endGroup();
|
|
||||||
|
|
||||||
s->endGroup();
|
s->endGroup();
|
||||||
|
TestFrameworkManager *frameworkManager = TestFrameworkManager::instance();
|
||||||
|
const QList<Core::Id> ®istered = frameworkManager->registeredFrameworkIds();
|
||||||
|
for (const Core::Id &id : registered) {
|
||||||
|
QSharedPointer<IFrameworkSettings> fSettings = frameworkManager->settingsForTestFramework(id);
|
||||||
|
if (!fSettings.isNull())
|
||||||
|
fSettings->toSettings(s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestSettings::fromSettings(QSettings *s)
|
void TestSettings::fromSettings(QSettings *s)
|
||||||
{
|
{
|
||||||
s->beginGroup(group);
|
s->beginGroup(Constants::SETTINGSGROUP);
|
||||||
timeout = s->value(timeoutKey, defaultTimeout).toInt();
|
timeout = s->value(timeoutKey, defaultTimeout).toInt();
|
||||||
omitInternalMssg = s->value(omitInternalKey, true).toBool();
|
omitInternalMssg = s->value(omitInternalKey, true).toBool();
|
||||||
omitRunConfigWarn = s->value(omitRunConfigWarnKey, false).toBool();
|
omitRunConfigWarn = s->value(omitRunConfigWarnKey, false).toBool();
|
||||||
@@ -88,15 +88,12 @@ void TestSettings::fromSettings(QSettings *s)
|
|||||||
frameworks.insert(id, s->value(QLatin1String(id.name()),
|
frameworks.insert(id, s->value(QLatin1String(id.name()),
|
||||||
frameworkManager->isActive(id)).toBool());
|
frameworkManager->isActive(id)).toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
s->beginGroup(qtTestSettings.name());
|
|
||||||
qtTestSettings.fromSettings(s);
|
|
||||||
s->endGroup();
|
|
||||||
s->beginGroup(gTestSettings.name());
|
|
||||||
gTestSettings.fromSettings(s);
|
|
||||||
s->endGroup();
|
|
||||||
|
|
||||||
s->endGroup();
|
s->endGroup();
|
||||||
|
for (const Core::Id &id : registered) {
|
||||||
|
QSharedPointer<IFrameworkSettings> fSettings = frameworkManager->settingsForTestFramework(id);
|
||||||
|
if (!fSettings.isNull())
|
||||||
|
fSettings->fromSettings(s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -25,9 +25,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "gtest/gtestsettings.h"
|
|
||||||
#include "qtest/qttestsettings.h"
|
|
||||||
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
|
||||||
namespace Core { class Id; }
|
namespace Core { class Id; }
|
||||||
@@ -52,9 +49,6 @@ struct TestSettings
|
|||||||
bool autoScroll = true;
|
bool autoScroll = true;
|
||||||
bool alwaysParse = true;
|
bool alwaysParse = true;
|
||||||
QHash<Core::Id, bool> frameworks;
|
QHash<Core::Id, bool> frameworks;
|
||||||
|
|
||||||
QtTestSettings qtTestSettings;
|
|
||||||
GTestSettings gTestSettings;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -29,6 +29,11 @@
|
|||||||
#include "testsettings.h"
|
#include "testsettings.h"
|
||||||
#include "testtreemodel.h"
|
#include "testtreemodel.h"
|
||||||
|
|
||||||
|
#include "gtest/gtestconstants.h"
|
||||||
|
#include "gtest/gtestsettings.h"
|
||||||
|
#include "qtest/qttestconstants.h"
|
||||||
|
#include "qtest/qttestsettings.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
@@ -37,6 +42,11 @@
|
|||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
static const Core::Id qid
|
||||||
|
= Core::Id(Constants::FRAMEWORK_PREFIX).withSuffix(QtTest::Constants::FRAMEWORK_NAME);
|
||||||
|
static const Core::Id gid
|
||||||
|
= Core::Id(Constants::FRAMEWORK_PREFIX).withSuffix(GTest::Constants::FRAMEWORK_NAME);
|
||||||
|
|
||||||
TestSettingsWidget::TestSettingsWidget(QWidget *parent)
|
TestSettingsWidget::TestSettingsWidget(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
@@ -66,34 +76,43 @@ void TestSettingsWidget::setSettings(const TestSettings &settings)
|
|||||||
m_ui.alwaysParseCB->setChecked(settings.alwaysParse);
|
m_ui.alwaysParseCB->setChecked(settings.alwaysParse);
|
||||||
populateFrameworksListWidget(settings.frameworks);
|
populateFrameworksListWidget(settings.frameworks);
|
||||||
|
|
||||||
m_ui.disableCrashhandlerCB->setChecked(settings.qtTestSettings.noCrashHandler);
|
auto qtTestSettings = qSharedPointerCast<QtTestSettings>(
|
||||||
switch (settings.qtTestSettings.metrics) {
|
TestFrameworkManager::instance()->settingsForTestFramework(qid));
|
||||||
case MetricsType::Walltime:
|
|
||||||
m_ui.walltimeRB->setChecked(true);
|
if (!qtTestSettings.isNull()) {
|
||||||
break;
|
m_ui.disableCrashhandlerCB->setChecked(qtTestSettings->noCrashHandler);
|
||||||
case MetricsType::TickCounter:
|
switch (qtTestSettings->metrics) {
|
||||||
m_ui.tickcounterRB->setChecked(true);
|
case MetricsType::Walltime:
|
||||||
break;
|
m_ui.walltimeRB->setChecked(true);
|
||||||
case MetricsType::EventCounter:
|
break;
|
||||||
m_ui.eventCounterRB->setChecked(true);
|
case MetricsType::TickCounter:
|
||||||
break;
|
m_ui.tickcounterRB->setChecked(true);
|
||||||
case MetricsType::CallGrind:
|
break;
|
||||||
m_ui.callgrindRB->setChecked(true);
|
case MetricsType::EventCounter:
|
||||||
break;
|
m_ui.eventCounterRB->setChecked(true);
|
||||||
case MetricsType::Perf:
|
break;
|
||||||
m_ui.perfRB->setChecked(true);
|
case MetricsType::CallGrind:
|
||||||
break;
|
m_ui.callgrindRB->setChecked(true);
|
||||||
default:
|
break;
|
||||||
m_ui.walltimeRB->setChecked(true);
|
case MetricsType::Perf:
|
||||||
|
m_ui.perfRB->setChecked(true);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
m_ui.walltimeRB->setChecked(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ui.runDisabledGTestsCB->setChecked(settings.gTestSettings.runDisabled);
|
auto gTestSettings = qSharedPointerCast<GTestSettings>(
|
||||||
m_ui.repeatGTestsCB->setChecked(settings.gTestSettings.repeat);
|
TestFrameworkManager::instance()->settingsForTestFramework(gid));
|
||||||
m_ui.shuffleGTestsCB->setChecked(settings.gTestSettings.shuffle);
|
if (!gTestSettings.isNull()) {
|
||||||
m_ui.repetitionSpin->setValue(settings.gTestSettings.iterations);
|
m_ui.runDisabledGTestsCB->setChecked(gTestSettings->runDisabled);
|
||||||
m_ui.seedSpin->setValue(settings.gTestSettings.seed);
|
m_ui.repeatGTestsCB->setChecked(gTestSettings->repeat);
|
||||||
m_ui.breakOnFailureCB->setChecked(settings.gTestSettings.breakOnFailure);
|
m_ui.shuffleGTestsCB->setChecked(gTestSettings->shuffle);
|
||||||
m_ui.throwOnFailureCB->setChecked(settings.gTestSettings.throwOnFailure);
|
m_ui.repetitionSpin->setValue(gTestSettings->iterations);
|
||||||
|
m_ui.seedSpin->setValue(gTestSettings->seed);
|
||||||
|
m_ui.breakOnFailureCB->setChecked(gTestSettings->breakOnFailure);
|
||||||
|
m_ui.throwOnFailureCB->setChecked(gTestSettings->throwOnFailure);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TestSettings TestSettingsWidget::settings() const
|
TestSettings TestSettingsWidget::settings() const
|
||||||
@@ -108,26 +127,34 @@ TestSettings TestSettingsWidget::settings() const
|
|||||||
result.frameworks = frameworks();
|
result.frameworks = frameworks();
|
||||||
|
|
||||||
// QtTestSettings
|
// QtTestSettings
|
||||||
result.qtTestSettings.noCrashHandler = m_ui.disableCrashhandlerCB->isChecked();
|
auto qtTestSettings = qSharedPointerCast<QtTestSettings>(
|
||||||
if (m_ui.walltimeRB->isChecked())
|
TestFrameworkManager::instance()->settingsForTestFramework(qid));
|
||||||
result.qtTestSettings.metrics = MetricsType::Walltime;
|
if (!qtTestSettings.isNull()) {
|
||||||
else if (m_ui.tickcounterRB->isChecked())
|
qtTestSettings->noCrashHandler = m_ui.disableCrashhandlerCB->isChecked();
|
||||||
result.qtTestSettings.metrics = MetricsType::TickCounter;
|
if (m_ui.walltimeRB->isChecked())
|
||||||
else if (m_ui.eventCounterRB->isChecked())
|
qtTestSettings->metrics = MetricsType::Walltime;
|
||||||
result.qtTestSettings.metrics = MetricsType::EventCounter;
|
else if (m_ui.tickcounterRB->isChecked())
|
||||||
else if (m_ui.callgrindRB->isChecked())
|
qtTestSettings->metrics = MetricsType::TickCounter;
|
||||||
result.qtTestSettings.metrics = MetricsType::CallGrind;
|
else if (m_ui.eventCounterRB->isChecked())
|
||||||
else if (m_ui.perfRB->isChecked())
|
qtTestSettings->metrics = MetricsType::EventCounter;
|
||||||
result.qtTestSettings.metrics = MetricsType::Perf;
|
else if (m_ui.callgrindRB->isChecked())
|
||||||
|
qtTestSettings->metrics = MetricsType::CallGrind;
|
||||||
|
else if (m_ui.perfRB->isChecked())
|
||||||
|
qtTestSettings->metrics = MetricsType::Perf;
|
||||||
|
}
|
||||||
|
|
||||||
// GTestSettings
|
// GTestSettings
|
||||||
result.gTestSettings.runDisabled = m_ui.runDisabledGTestsCB->isChecked();
|
auto gTestSettings = qSharedPointerCast<GTestSettings>(
|
||||||
result.gTestSettings.repeat = m_ui.repeatGTestsCB->isChecked();
|
TestFrameworkManager::instance()->settingsForTestFramework(gid));
|
||||||
result.gTestSettings.shuffle = m_ui.shuffleGTestsCB->isChecked();
|
if (!gTestSettings.isNull()) {
|
||||||
result.gTestSettings.iterations = m_ui.repetitionSpin->value();
|
gTestSettings->runDisabled = m_ui.runDisabledGTestsCB->isChecked();
|
||||||
result.gTestSettings.seed = m_ui.seedSpin->value();
|
gTestSettings->repeat = m_ui.repeatGTestsCB->isChecked();
|
||||||
result.gTestSettings.breakOnFailure = m_ui.breakOnFailureCB->isChecked();
|
gTestSettings->shuffle = m_ui.shuffleGTestsCB->isChecked();
|
||||||
result.gTestSettings.throwOnFailure = m_ui.throwOnFailureCB->isChecked();
|
gTestSettings->iterations = m_ui.repetitionSpin->value();
|
||||||
|
gTestSettings->seed = m_ui.seedSpin->value();
|
||||||
|
gTestSettings->breakOnFailure = m_ui.breakOnFailureCB->isChecked();
|
||||||
|
gTestSettings->throwOnFailure = m_ui.throwOnFailureCB->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user