tizendevicetester.cpp 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /****************************************************************************
  2. **
  3. ** Copyright (C) 2013 Jarek Pelczar <jpelczar@gmail.com>
  4. **
  5. ** This file is part of Qt Creator.
  6. **
  7. ** Commercial License Usage
  8. ** Licensees holding valid commercial Qt licenses may use this file in
  9. ** accordance with the commercial license agreement provided with the
  10. ** Software or, alternatively, in accordance with the terms contained in
  11. ** a written agreement between you and Digia. For licensing terms and
  12. ** conditions see http://qt.digia.com/licensing. For further information
  13. ** use the contact form at http://qt.digia.com/contact-us.
  14. **
  15. ** GNU Lesser General Public License Usage
  16. ** Alternatively, this file may be used under the terms of the GNU Lesser
  17. ** General Public License version 2.1 as published by the Free Software
  18. ** Foundation and appearing in the file LICENSE.LGPL included in the
  19. ** packaging of this file. Please review the following information to
  20. ** ensure the GNU Lesser General Public License version 2.1 requirements
  21. ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
  22. **
  23. ** In addition, as a special exception, Digia gives you certain additional
  24. ** rights. These rights are described in the Digia Qt LGPL Exception
  25. ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
  26. **
  27. ****************************************************************************/
  28. #include "tizendevicetester.h"
  29. #include <utils/qtcassert.h>
  30. #include <coreplugin/id.h>
  31. #include <QTextStream>
  32. //namespace Tizen {
  33. //TizenDeviceTester::TizenDeviceTester(QPointer<Tizen::SdbConnector> connector, QObject *parent) :
  34. // ProjectExplorer::DeviceTester(parent),
  35. // m_connector(connector),
  36. // m_command(NULL)
  37. //{
  38. //}
  39. //TizenDeviceTester::~TizenDeviceTester()
  40. //{
  41. //}
  42. //void TizenDeviceTester::beginCommand(const QString& cmd)
  43. //{
  44. // m_command = new Tizen::SdbCommandExecutor(m_connector.data(), this);
  45. // connect(m_command, SIGNAL(finished()), SLOT(commandSuccess()));
  46. // connect(m_command, SIGNAL(failed()), SLOT(commandFailed()));
  47. // m_command->start(m_device->id().toString(), cmd);
  48. //}
  49. //void TizenDeviceTester::testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration)
  50. //{
  51. // QTC_ASSERT(!m_command, return);
  52. // m_device = deviceConfiguration;
  53. // m_commandId = 0;
  54. // emit progressMessage(tr("Checking device architecture ..."));
  55. // beginCommand(QLatin1String("uname -m"));
  56. //}
  57. //void TizenDeviceTester::stopTest()
  58. //{
  59. // QTC_ASSERT(m_command, return);
  60. // delete m_command;
  61. // m_command = NULL;
  62. // emit finished(TestFailure);
  63. //}
  64. //void TizenDeviceTester::commandFailed()
  65. //{
  66. // emit errorMessage(tr("Can't execute command: %1").arg(m_command->errorString()));
  67. // m_command->deleteLater();
  68. // m_command = NULL;
  69. // emit finished(TestFailure);
  70. //}
  71. //void TizenDeviceTester::commandSuccess()
  72. //{
  73. // if(m_commandId == 0 || m_commandId == 1) {
  74. // emit progressMessage(QString::fromUtf8(m_command->readAll()));
  75. // } else if(m_commandId == 2) {
  76. // QTextStream ts(m_command);
  77. // int value = -1;
  78. // ts >> value;
  79. // if(value == 0)
  80. // emit progressMessage(tr("Yes"));
  81. // else
  82. // emit progressMessage(tr("No"));
  83. // } else if(m_commandId == 3) {
  84. // QByteArray text = m_command->readLine();
  85. // if(text == "root")
  86. // emit progressMessage(tr("Yes"));
  87. // else
  88. // emit progressMessage(tr("No"));
  89. // }
  90. // m_command->deleteLater();
  91. // m_command = NULL;
  92. // ++m_commandId;
  93. // switch(m_commandId)
  94. // {
  95. // case 1:
  96. // emit progressMessage(tr("Checking kernel version ..."));
  97. // beginCommand(QLatin1String("uname -rsm"));
  98. // break;
  99. // case 2:
  100. // emit progressMessage(tr("Checking if device is emulator ..."));
  101. // beginCommand(QLatin1String("ls -la /dev/samsung_sdb 2> /dev/null | wc -l"));
  102. // break;
  103. // case 3:
  104. // emit progressMessage(tr("Checking if user is root ..."));
  105. // beginCommand(QLatin1String("whoami"));
  106. // break;
  107. // default:
  108. // emit finished(TestSuccess);
  109. // }
  110. //}
  111. //} // namespace Tizen