2014-10-07 15:51:02 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-22 10:37:55 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2014-10-07 15:51:02 +02:00
|
|
|
**
|
2016-01-22 10:37:55 +01:00
|
|
|
** This file is part of Qt Creator.
|
2014-10-07 15:51:02 +02:00
|
|
|
**
|
2016-01-22 10:37:55 +01:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
2014-10-07 15:51:02 +02:00
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-22 10:37:55 +01:00
|
|
|
** 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.
|
2014-10-07 15:51:02 +02:00
|
|
|
**
|
2016-01-22 10:37:55 +01:00
|
|
|
** 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.
|
2014-10-07 15:51:02 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2014-10-07 15:51:02 +02:00
|
|
|
|
2016-01-12 13:52:21 +01:00
|
|
|
#include "autotestconstants.h"
|
|
|
|
|
|
2016-01-18 14:37:32 +01:00
|
|
|
#include <projectexplorer/project.h>
|
2014-10-07 15:51:02 +02:00
|
|
|
#include <utils/environment.h>
|
|
|
|
|
|
2016-04-29 10:13:35 +02:00
|
|
|
#include <QFutureInterface>
|
2014-10-07 15:51:02 +02:00
|
|
|
#include <QObject>
|
2016-01-18 14:37:32 +01:00
|
|
|
#include <QPointer>
|
2014-10-07 15:51:02 +02:00
|
|
|
#include <QStringList>
|
|
|
|
|
|
2016-04-29 10:13:35 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QProcess;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2014-10-07 15:51:02 +02:00
|
|
|
namespace Autotest {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2016-04-29 10:13:35 +02:00
|
|
|
class TestOutputReader;
|
|
|
|
|
class TestResult;
|
2016-05-19 16:53:56 +02:00
|
|
|
struct TestSettings;
|
2016-04-29 10:13:35 +02:00
|
|
|
|
|
|
|
|
using TestResultPtr = QSharedPointer<TestResult>;
|
|
|
|
|
|
|
|
|
|
class TestConfiguration
|
2014-10-07 15:51:02 +02:00
|
|
|
|
|
|
|
|
{
|
|
|
|
|
public:
|
2016-04-29 10:13:35 +02:00
|
|
|
explicit TestConfiguration();
|
|
|
|
|
virtual ~TestConfiguration();
|
2014-10-07 15:51:02 +02:00
|
|
|
|
2015-04-27 16:11:28 +02:00
|
|
|
void completeTestInformation();
|
|
|
|
|
|
2014-11-06 16:01:06 +01:00
|
|
|
void setTestCases(const QStringList &testCases);
|
|
|
|
|
void setTestCaseCount(int count);
|
2014-10-07 15:51:02 +02:00
|
|
|
void setTargetFile(const QString &targetFile);
|
|
|
|
|
void setTargetName(const QString &targetName);
|
|
|
|
|
void setProFile(const QString &proFile);
|
|
|
|
|
void setWorkingDirectory(const QString &workingDirectory);
|
2016-01-26 17:24:11 +01:00
|
|
|
void setBuildDirectory(const QString &buildDirectory);
|
2014-11-13 12:31:58 +01:00
|
|
|
void setDisplayName(const QString &displayName);
|
2014-10-07 15:51:02 +02:00
|
|
|
void setEnvironment(const Utils::Environment &env);
|
|
|
|
|
void setProject(ProjectExplorer::Project *project);
|
2015-02-17 10:33:35 +01:00
|
|
|
void setGuessedConfiguration(bool guessed);
|
2014-10-07 15:51:02 +02:00
|
|
|
|
|
|
|
|
QStringList testCases() const { return m_testCases; }
|
2014-11-03 08:30:22 +01:00
|
|
|
int testCaseCount() const { return m_testCaseCount; }
|
2014-10-07 15:51:02 +02:00
|
|
|
QString proFile() const { return m_proFile; }
|
|
|
|
|
QString targetFile() const { return m_targetFile; }
|
|
|
|
|
QString targetName() const { return m_targetName; }
|
|
|
|
|
QString workingDirectory() const { return m_workingDir; }
|
2016-01-26 17:24:11 +01:00
|
|
|
QString buildDirectory() const { return m_buildDir; }
|
2014-11-13 12:31:58 +01:00
|
|
|
QString displayName() const { return m_displayName; }
|
2014-10-07 15:51:02 +02:00
|
|
|
Utils::Environment environment() const { return m_environment; }
|
2016-01-18 14:37:32 +01:00
|
|
|
ProjectExplorer::Project *project() const { return m_project.data(); }
|
2015-02-17 10:33:35 +01:00
|
|
|
bool guessedConfiguration() const { return m_guessedConfiguration; }
|
2016-04-29 10:13:35 +02:00
|
|
|
|
|
|
|
|
virtual TestOutputReader *outputReader(const QFutureInterface<TestResultPtr> &fi,
|
|
|
|
|
QProcess *app) const = 0;
|
|
|
|
|
virtual QStringList argumentsForTestRunner(const TestSettings &settings) const = 0;
|
2014-10-07 15:51:02 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QStringList m_testCases;
|
2016-04-29 10:13:35 +02:00
|
|
|
int m_testCaseCount = 0;
|
2014-10-07 15:51:02 +02:00
|
|
|
QString m_proFile;
|
|
|
|
|
QString m_targetFile;
|
|
|
|
|
QString m_targetName;
|
|
|
|
|
QString m_workingDir;
|
2016-01-26 17:24:11 +01:00
|
|
|
QString m_buildDir;
|
2014-11-13 12:31:58 +01:00
|
|
|
QString m_displayName;
|
2014-10-07 15:51:02 +02:00
|
|
|
Utils::Environment m_environment;
|
2016-01-18 14:37:32 +01:00
|
|
|
QPointer<ProjectExplorer::Project> m_project;
|
2016-04-29 10:13:35 +02:00
|
|
|
bool m_guessedConfiguration = false;
|
|
|
|
|
};
|
|
|
|
|
|
2014-10-07 15:51:02 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Autotest
|