forked from qt-creator/qt-creator
Autotest: Remove unused TestConfiguration::setExecutableFile
... and a few unncessary namespace qualifications. Change-Id: If1dde79a0b6b68ba8706faf038c3512f0b3e666f Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -52,7 +52,7 @@ using namespace Utils;
|
|||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
|
|
||||||
|
|
||||||
ITestConfiguration::ITestConfiguration(Autotest::ITestBase *testBase)
|
ITestConfiguration::ITestConfiguration(ITestBase *testBase)
|
||||||
: m_testBase(testBase)
|
: m_testBase(testBase)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -62,14 +62,14 @@ void ITestConfiguration::setWorkingDirectory(const FilePath &workingDirectory)
|
|||||||
m_runnable.workingDirectory = workingDirectory;
|
m_runnable.workingDirectory = workingDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePath ITestConfiguration::workingDirectory() const
|
FilePath ITestConfiguration::workingDirectory() const
|
||||||
{
|
{
|
||||||
if (!m_runnable.workingDirectory.isEmpty()) {
|
if (!m_runnable.workingDirectory.isEmpty()) {
|
||||||
if (m_runnable.workingDirectory.isDir()) // ensure wanted working dir does exist
|
if (m_runnable.workingDirectory.isDir()) // ensure wanted working dir does exist
|
||||||
return m_runnable.workingDirectory.absoluteFilePath();
|
return m_runnable.workingDirectory.absoluteFilePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
const Utils::FilePath executable = executableFilePath();
|
const FilePath executable = executableFilePath();
|
||||||
return executable.isEmpty() ? executable : executable.absolutePath();
|
return executable.isEmpty() ? executable : executable.absolutePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ bool ITestConfiguration::hasExecutable() const
|
|||||||
return !m_runnable.command.isEmpty();
|
return !m_runnable.command.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePath ITestConfiguration::executableFilePath() const
|
FilePath ITestConfiguration::executableFilePath() const
|
||||||
{
|
{
|
||||||
if (!hasExecutable())
|
if (!hasExecutable())
|
||||||
return {};
|
return {};
|
||||||
@@ -89,7 +89,7 @@ Utils::FilePath ITestConfiguration::executableFilePath() const
|
|||||||
QString fullCommandFileName = m_runnable.command.executable().toString();
|
QString fullCommandFileName = m_runnable.command.executable().toString();
|
||||||
// TODO: check if we can use searchInPath() from Utils::Environment
|
// TODO: check if we can use searchInPath() from Utils::Environment
|
||||||
const QStringList &pathList = m_runnable.environment.toProcessEnvironment().value("PATH")
|
const QStringList &pathList = m_runnable.environment.toProcessEnvironment().value("PATH")
|
||||||
.split(Utils::HostOsInfo::pathListSeparator());
|
.split(HostOsInfo::pathListSeparator());
|
||||||
|
|
||||||
for (const QString &path : pathList) {
|
for (const QString &path : pathList) {
|
||||||
QString filePath(path + QDir::separator() + fullCommandFileName);
|
QString filePath(path + QDir::separator() + fullCommandFileName);
|
||||||
@@ -156,7 +156,7 @@ void TestConfiguration::completeTestInformation(ProjectExplorer::RunConfiguratio
|
|||||||
if (!targetInfo.targetFilePath.isEmpty())
|
if (!targetInfo.targetFilePath.isEmpty())
|
||||||
m_runnable.command.setExecutable(ensureExeEnding(targetInfo.targetFilePath));
|
m_runnable.command.setExecutable(ensureExeEnding(targetInfo.targetFilePath));
|
||||||
|
|
||||||
Utils::FilePath buildBase;
|
FilePath buildBase;
|
||||||
if (auto buildConfig = target->activeBuildConfiguration()) {
|
if (auto buildConfig = target->activeBuildConfiguration()) {
|
||||||
buildBase = buildConfig->buildDirectory();
|
buildBase = buildConfig->buildDirectory();
|
||||||
const QString projBase = startupProject->projectDirectory().toString();
|
const QString projBase = startupProject->projectDirectory().toString();
|
||||||
@@ -222,7 +222,7 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode)
|
|||||||
if (localExecutable.isEmpty())
|
if (localExecutable.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Utils::FilePath buildBase;
|
FilePath buildBase;
|
||||||
if (auto buildConfig = target->activeBuildConfiguration()) {
|
if (auto buildConfig = target->activeBuildConfiguration()) {
|
||||||
buildBase = buildConfig->buildDirectory();
|
buildBase = buildConfig->buildDirectory();
|
||||||
const QString projBase = startupProject->projectDirectory().toString();
|
const QString projBase = startupProject->projectDirectory().toString();
|
||||||
@@ -315,12 +315,7 @@ void TestConfiguration::setTestCases(const QStringList &testCases)
|
|||||||
setTestCaseCount(m_testCases.size());
|
setTestCaseCount(m_testCases.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestConfiguration::setExecutableFile(const QString &executableFile)
|
void TestConfiguration::setProjectFile(const FilePath &projectFile)
|
||||||
{
|
|
||||||
m_runnable.command.setExecutable(Utils::FilePath::fromString(executableFile));
|
|
||||||
}
|
|
||||||
|
|
||||||
void TestConfiguration::setProjectFile(const Utils::FilePath &projectFile)
|
|
||||||
{
|
{
|
||||||
m_projectFile = projectFile;
|
m_projectFile = projectFile;
|
||||||
}
|
}
|
||||||
|
@@ -98,7 +98,6 @@ public:
|
|||||||
void completeTestInformation(ProjectExplorer::RunConfiguration *rc, TestRunMode runMode);
|
void completeTestInformation(ProjectExplorer::RunConfiguration *rc, TestRunMode runMode);
|
||||||
|
|
||||||
void setTestCases(const QStringList &testCases);
|
void setTestCases(const QStringList &testCases);
|
||||||
void setExecutableFile(const QString &executableFile);
|
|
||||||
void setProjectFile(const Utils::FilePath &projectFile);
|
void setProjectFile(const Utils::FilePath &projectFile);
|
||||||
void setBuildDirectory(const Utils::FilePath &buildDirectory);
|
void setBuildDirectory(const Utils::FilePath &buildDirectory);
|
||||||
void setInternalTarget(const QString &target);
|
void setInternalTarget(const QString &target);
|
||||||
|
Reference in New Issue
Block a user