forked from qt-creator/qt-creator
Qnx: DeviceTester code cosmetics
Change-Id: I77463ecde1c64333de35b33773f3eacf275f983f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -33,7 +33,7 @@ static QStringList versionSpecificCommandsToTest(int versionNumber)
|
||||
return {};
|
||||
}
|
||||
|
||||
void QnxDeviceTester::testDevice(const ProjectExplorer::IDevice::Ptr &deviceConfiguration)
|
||||
void QnxDeviceTester::testDevice(const ProjectExplorer::IDevice::Ptr &device)
|
||||
{
|
||||
static const QStringList s_commandsToTest = {"awk",
|
||||
"cat",
|
||||
@@ -52,8 +52,8 @@ void QnxDeviceTester::testDevice(const ProjectExplorer::IDevice::Ptr &deviceConf
|
||||
"sleep",
|
||||
"tail",
|
||||
"uname"};
|
||||
m_deviceConfiguration = deviceConfiguration;
|
||||
QnxDevice::ConstPtr qnxDevice = m_deviceConfiguration.dynamicCast<const QnxDevice>();
|
||||
m_device = device;
|
||||
QnxDevice::ConstPtr qnxDevice = m_device.dynamicCast<const QnxDevice>();
|
||||
m_genericTester->setExtraCommandsToTest(
|
||||
s_commandsToTest + versionSpecificCommandsToTest(qnxDevice->qnxVersion()));
|
||||
|
||||
@@ -63,7 +63,7 @@ void QnxDeviceTester::testDevice(const ProjectExplorer::IDevice::Ptr &deviceConf
|
||||
emit progressMessage(Tr::tr("Checking that files can be created in %1...")
|
||||
.arg(Constants::QNX_TMP_DIR));
|
||||
const QString pidFile = QString("%1/qtc_xxxx.pid").arg(Constants::QNX_TMP_DIR);
|
||||
const CommandLine cmd(m_deviceConfiguration->filePath("/bin/sh"),
|
||||
const CommandLine cmd(m_device->filePath("/bin/sh"),
|
||||
{"-c", QLatin1String("rm %1 > /dev/null 2>&1; echo ABC > %1 && rm %1").arg(pidFile)});
|
||||
process.setCommand(cmd);
|
||||
};
|
||||
@@ -79,7 +79,7 @@ void QnxDeviceTester::testDevice(const ProjectExplorer::IDevice::Ptr &deviceConf
|
||||
};
|
||||
m_genericTester->setExtraTests({Process(setupHandler, doneHandler, errorHandler)});
|
||||
|
||||
m_genericTester->testDevice(deviceConfiguration);
|
||||
m_genericTester->testDevice(device);
|
||||
}
|
||||
|
||||
void QnxDeviceTester::stopTest()
|
||||
|
@@ -5,23 +5,19 @@
|
||||
|
||||
#include <remotelinux/linuxdevicetester.h>
|
||||
|
||||
namespace Qnx {
|
||||
namespace Internal {
|
||||
namespace Qnx::Internal {
|
||||
|
||||
class QnxDeviceTester : public ProjectExplorer::DeviceTester
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QnxDeviceTester(QObject *parent = nullptr);
|
||||
|
||||
void testDevice(const ProjectExplorer::IDevice::Ptr &deviceConfiguration) override;
|
||||
void testDevice(const ProjectExplorer::IDevice::Ptr &device) override;
|
||||
void stopTest() override;
|
||||
|
||||
private:
|
||||
RemoteLinux::GenericLinuxDeviceTester *m_genericTester = nullptr;
|
||||
ProjectExplorer::IDevice::ConstPtr m_deviceConfiguration;
|
||||
ProjectExplorer::IDevice::ConstPtr m_device;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Qnx
|
||||
} // Qnx::Internal
|
||||
|
Reference in New Issue
Block a user