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.
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include "quicktestconfiguration.h"
|
2016-10-05 12:39:23 +02:00
|
|
|
#include "../qtest/qttestconstants.h"
|
2016-05-11 13:02:42 +02:00
|
|
|
#include "../qtest/qttestoutputreader.h"
|
2016-10-05 12:39:23 +02:00
|
|
|
#include "../qtest/qttestsettings.h"
|
2017-09-01 14:59:39 +02:00
|
|
|
#include "../qtest/qttest_utils.h"
|
|
|
|
#include "../autotestplugin.h"
|
2020-03-26 10:11:39 +01:00
|
|
|
#include "../itestframework.h"
|
2017-09-01 14:59:39 +02:00
|
|
|
#include "../testsettings.h"
|
2016-05-11 13:02:42 +02:00
|
|
|
|
2020-06-17 06:35:31 +02:00
|
|
|
#include <utils/stringutils.h>
|
|
|
|
|
2016-05-11 13:02:42 +02:00
|
|
|
namespace Autotest {
|
|
|
|
namespace Internal {
|
|
|
|
|
2020-03-26 10:11:39 +01:00
|
|
|
QuickTestConfiguration::QuickTestConfiguration(ITestFramework *framework)
|
|
|
|
: DebuggableTestConfiguration(framework)
|
2017-09-29 15:01:32 +02:00
|
|
|
{
|
|
|
|
setMixedDebugging(true);
|
|
|
|
}
|
|
|
|
|
2016-05-11 13:02:42 +02:00
|
|
|
TestOutputReader *QuickTestConfiguration::outputReader(const QFutureInterface<TestResultPtr> &fi,
|
|
|
|
QProcess *app) const
|
|
|
|
{
|
2020-03-26 10:11:39 +01:00
|
|
|
auto qtSettings = dynamic_cast<QtTestSettings *>(framework()->frameworkSettings());
|
2018-05-15 07:28:25 +02:00
|
|
|
const QtTestOutputReader::OutputMode mode = qtSettings && qtSettings->useXMLOutput
|
|
|
|
? QtTestOutputReader::XML
|
|
|
|
: QtTestOutputReader::PlainText;
|
|
|
|
return new QtTestOutputReader(fi, app, buildDirectory(), projectFile(),
|
|
|
|
mode, TestType::QuickTest);
|
2016-05-11 13:02:42 +02:00
|
|
|
}
|
|
|
|
|
2017-09-01 14:59:39 +02:00
|
|
|
QStringList QuickTestConfiguration::argumentsForTestRunner(QStringList *omitted) const
|
2016-05-11 13:02:42 +02:00
|
|
|
{
|
2017-06-19 15:58:21 +02:00
|
|
|
QStringList arguments;
|
2018-02-01 09:17:56 +01:00
|
|
|
if (AutotestPlugin::settings()->processArgs) {
|
2017-09-01 14:59:39 +02:00
|
|
|
arguments.append(QTestUtils::filterInterfering
|
2020-07-21 10:19:36 +02:00
|
|
|
(runnable().commandLineArguments.split(' ', Qt::SkipEmptyParts),
|
2017-09-01 14:59:39 +02:00
|
|
|
omitted, true));
|
|
|
|
}
|
|
|
|
|
2020-03-26 10:11:39 +01:00
|
|
|
auto qtSettings = dynamic_cast<QtTestSettings *>(framework()->frameworkSettings());
|
2020-03-12 13:58:09 +01:00
|
|
|
if (!qtSettings)
|
2016-10-05 12:39:23 +02:00
|
|
|
return arguments;
|
2017-06-19 15:58:21 +02:00
|
|
|
if (qtSettings->useXMLOutput)
|
|
|
|
arguments << "-xml";
|
2020-01-15 19:10:34 +01:00
|
|
|
if (!testCases().isEmpty())
|
2017-06-19 15:58:21 +02:00
|
|
|
arguments << testCases();
|
2016-10-05 12:39:23 +02:00
|
|
|
|
|
|
|
const QString &metricsOption = QtTestSettings::metricsTypeToOption(qtSettings->metrics);
|
|
|
|
if (!metricsOption.isEmpty())
|
|
|
|
arguments << metricsOption;
|
2017-09-29 15:01:32 +02:00
|
|
|
|
|
|
|
if (isDebugRunMode()) {
|
|
|
|
if (qtSettings->noCrashHandler)
|
|
|
|
arguments << "-nocrashhandler";
|
|
|
|
}
|
2016-05-11 13:02:42 +02:00
|
|
|
return arguments;
|
|
|
|
}
|
|
|
|
|
2018-08-29 12:33:15 +02:00
|
|
|
Utils::Environment QuickTestConfiguration::filteredEnvironment(const Utils::Environment &original) const
|
|
|
|
{
|
|
|
|
return QTestUtils::prepareBasicEnvironment(original);
|
|
|
|
}
|
|
|
|
|
2016-05-11 13:02:42 +02:00
|
|
|
void QuickTestConfiguration::setUnnamedOnly(bool unnamedOnly)
|
|
|
|
{
|
|
|
|
m_unnamedOnly = unnamedOnly;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
} // namespace Autotest
|