From bee86235a33450405445605d15fe11bd86877fd3 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sat, 26 Jan 2019 09:52:58 -0800 Subject: [PATCH 1/3] Corrected error message. --- tools/nitpick/src/TestRunnerMobile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/nitpick/src/TestRunnerMobile.cpp b/tools/nitpick/src/TestRunnerMobile.cpp index 6bc34f26a8..e7191dcfad 100644 --- a/tools/nitpick/src/TestRunnerMobile.cpp +++ b/tools/nitpick/src/TestRunnerMobile.cpp @@ -64,8 +64,8 @@ void TestRunnerMobile::setWorkingFolderAndEnableControls() { _adbCommand = adbExePath + "/" + _adbExe; } else { - QMessageBox::critical(0, "PYTHON_PATH not defined", - "Please set PYTHON_PATH to directory containing the Python executable"); + QMessageBox::critical(0, "ADB_PATH not defined", + "Please set ADB_PATH to directory containing the `adb` executable"); exit(-1); } #elif defined Q_OS_MAC From 94d741480c1751b880a7b2877c0498cea177b8e1 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sat, 26 Jan 2019 14:59:30 -0800 Subject: [PATCH 2/3] Added missing SSL dll's --- tools/nitpick/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/nitpick/CMakeLists.txt b/tools/nitpick/CMakeLists.txt index 9d5d38ec1f..f825775879 100644 --- a/tools/nitpick/CMakeLists.txt +++ b/tools/nitpick/CMakeLists.txt @@ -157,6 +157,13 @@ if (WIN32) COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/AppDataHighFidelity" "AppDataHighFidelity" ) endif () + + # add a custom command to copy the SSL DLLs + add_custom_command( + TARGET ${TARGET_NAME} + POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy_directory "$ENV{VCPKG_ROOT}/installed/x64-windows/bin" "$" + ) elseif (APPLE) add_custom_command( TARGET ${TARGET_NAME} From f248beba9fd967c44bb52e06c392a17c72dcd84d Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sun, 27 Jan 2019 23:43:07 -0800 Subject: [PATCH 3/3] Added device description + running Interface. --- tools/nitpick/src/Nitpick.cpp | 5 +++ tools/nitpick/src/Nitpick.h | 1 + tools/nitpick/src/TestRunnerMobile.cpp | 46 ++++++++++++++++++++------ tools/nitpick/src/TestRunnerMobile.h | 5 +++ tools/nitpick/ui/Nitpick.ui | 22 ++++++++++-- 5 files changed, 65 insertions(+), 14 deletions(-) diff --git a/tools/nitpick/src/Nitpick.cpp b/tools/nitpick/src/Nitpick.cpp index 9e385bcd4d..78ed0ca0af 100644 --- a/tools/nitpick/src/Nitpick.cpp +++ b/tools/nitpick/src/Nitpick.cpp @@ -113,6 +113,7 @@ void Nitpick::setup() { _ui.folderLineEdit, _ui.downloadAPKPushbutton, _ui.installAPKPushbutton, + _ui.runInterfacePushbutton, _ui.runLatestOnMobileCheckBox, _ui.urlOnMobileLineEdit, _ui.statusLabelOnMobile @@ -367,6 +368,10 @@ void Nitpick::on_installAPKPushbutton_clicked() { _testRunnerMobile->installAPK(); } +void Nitpick::on_runInterfacePushbutton_clicked() { + _testRunnerMobile->runInterface(); +} + void Nitpick::on_pullFolderPushbutton_clicked() { _testRunnerMobile->pullFolder(); } diff --git a/tools/nitpick/src/Nitpick.h b/tools/nitpick/src/Nitpick.h index 00516d1e76..29726be3bd 100644 --- a/tools/nitpick/src/Nitpick.h +++ b/tools/nitpick/src/Nitpick.h @@ -101,6 +101,7 @@ private slots: void on_downloadAPKPushbutton_clicked(); void on_installAPKPushbutton_clicked(); + void on_runInterfacePushbutton_clicked(); void on_pullFolderPushbutton_clicked(); diff --git a/tools/nitpick/src/TestRunnerMobile.cpp b/tools/nitpick/src/TestRunnerMobile.cpp index e7191dcfad..10216f248c 100644 --- a/tools/nitpick/src/TestRunnerMobile.cpp +++ b/tools/nitpick/src/TestRunnerMobile.cpp @@ -24,6 +24,7 @@ TestRunnerMobile::TestRunnerMobile( QLineEdit *folderLineEdit, QPushButton* downloadAPKPushbutton, QPushButton* installAPKPushbutton, + QPushButton* runInterfacePushbutton, QCheckBox* runLatest, QLineEdit* url, QLabel* statusLabel, @@ -38,22 +39,16 @@ TestRunnerMobile::TestRunnerMobile( _folderLineEdit = folderLineEdit; _downloadAPKPushbutton = downloadAPKPushbutton; _installAPKPushbutton = installAPKPushbutton; + _runInterfacePushbutton = runInterfacePushbutton; _runLatest = runLatest; _url = url; _statusLabel = statusLabel; folderLineEdit->setText("/sdcard/DCIM/TEST"); -} -TestRunnerMobile::~TestRunnerMobile() { -} + modelNames["SM_G955U1"] = "Samsung S8+ unlocked"; -void TestRunnerMobile::setWorkingFolderAndEnableControls() { - setWorkingFolder(_workingFolderLabel); - - _connectDeviceButton->setEnabled(true); - - // Find ADB (Android Debugging Bridge) before continuing + // Find ADB (Android Debugging Bridge) #ifdef Q_OS_WIN if (QProcessEnvironment::systemEnvironment().contains("ADB_PATH")) { QString adbExePath = QProcessEnvironment::systemEnvironment().value("ADB_PATH") + "/platform-tools"; @@ -78,10 +73,19 @@ void TestRunnerMobile::setWorkingFolderAndEnableControls() { #endif } +TestRunnerMobile::~TestRunnerMobile() { +} + +void TestRunnerMobile::setWorkingFolderAndEnableControls() { + setWorkingFolder(_workingFolderLabel); + + _connectDeviceButton->setEnabled(true); +} + void TestRunnerMobile::connectDevice() { #if defined Q_OS_WIN || defined Q_OS_MAC QString devicesFullFilename{ _workingFolder + "/devices.txt" }; - QString command = _adbCommand + " devices > " + devicesFullFilename; + QString command = _adbCommand + " devices -l > " + devicesFullFilename; system(command.toStdString().c_str()); if (!QFile::exists(devicesFullFilename)) { @@ -103,7 +107,17 @@ void TestRunnerMobile::connectDevice() { QMessageBox::critical(0, "Too many devices detected", "Tests will run only if a single device is attached"); } else { - _detectedDeviceLabel->setText(line2.remove(DEVICE)); + // Line looks like this: 988a1b47335239434b device product:dream2qlteue model:SM_G955U1 device:dream2qlteue transport_id:2 + QStringList tokens = line2.split(QRegExp("[\r\n\t ]+")); + QString deviceID = tokens[0]; + + QString modelID = tokens[3].split(':')[1]; + QString modelName = "UKNOWN"; + if (modelNames.count(modelID) == 1) { + modelName = modelNames[modelID]; + } + + _detectedDeviceLabel->setText(modelName + " [" + deviceID + "]"); _pullFolderButton->setEnabled(true); _folderLineEdit->setEnabled(true); _downloadAPKPushbutton->setEnabled(true); @@ -159,6 +173,16 @@ void TestRunnerMobile::installAPK() { QString command = _adbCommand + " install -r -d " + _workingFolder + "/" + _installerFilename + " >" + _workingFolder + "/installOutput.txt"; system(command.toStdString().c_str()); _statusLabel->setText("Installation complete"); + _runInterfacePushbutton->setEnabled(true); +#endif +} + +void TestRunnerMobile::runInterface() { +#if defined Q_OS_WIN || defined Q_OS_MAC + _statusLabel->setText("Starting Interface"); + QString command = _adbCommand + " shell monkey -p io.highfidelity.hifiinterface -v 1"; + system(command.toStdString().c_str()); + _statusLabel->setText("Interface started"); #endif } diff --git a/tools/nitpick/src/TestRunnerMobile.h b/tools/nitpick/src/TestRunnerMobile.h index 4cf31f6bd4..247f864976 100644 --- a/tools/nitpick/src/TestRunnerMobile.h +++ b/tools/nitpick/src/TestRunnerMobile.h @@ -11,6 +11,7 @@ #ifndef hifi_testRunnerMobile_h #define hifi_testRunnerMobile_h +#include #include #include #include @@ -28,6 +29,7 @@ public: QLineEdit *folderLineEdit, QPushButton* downloadAPKPushbutton, QPushButton* installAPKPushbutton, + QPushButton* runInterfacePushbutton, QCheckBox* runLatest, QLineEdit* url, QLabel* statusLabel, @@ -41,6 +43,7 @@ public: void downloadComplete(); void downloadAPK(); + void runInterface(); void installAPK(); @@ -53,6 +56,7 @@ private: QLineEdit* _folderLineEdit; QPushButton* _downloadAPKPushbutton; QPushButton* _installAPKPushbutton; + QPushButton* _runInterfacePushbutton; #ifdef Q_OS_WIN const QString _adbExe{ "adb.exe" }; @@ -65,5 +69,6 @@ private: QString _adbCommand; + std::map modelNames; }; #endif diff --git a/tools/nitpick/ui/Nitpick.ui b/tools/nitpick/ui/Nitpick.ui index 8d69317369..319452233f 100644 --- a/tools/nitpick/ui/Nitpick.ui +++ b/tools/nitpick/ui/Nitpick.ui @@ -43,7 +43,7 @@ - 0 + 3 @@ -613,7 +613,7 @@ 460 - 350 + 410 160 30 @@ -629,7 +629,7 @@ 10 - 350 + 410 440 30 @@ -725,6 +725,22 @@ Install APK + + + false + + + + 10 + 300 + 160 + 30 + + + + Run Interface + +