mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-07 10:02:24 +02:00
Can pull folder on Windows.
This commit is contained in:
parent
0c6d3be037
commit
12b8442e71
4 changed files with 30 additions and 7 deletions
|
@ -93,7 +93,7 @@ void Nitpick::setup() {
|
|||
if (_testRunnerMobile) {
|
||||
delete _testRunnerMobile;
|
||||
}
|
||||
_testRunnerMobile = new TestRunnerMobile(_ui.workingFolderRunOnMobileLabel, _ui.connectDeviceButton, _ui.pullFolderButton, _ui.detectedDeviceLabel);
|
||||
_testRunnerMobile = new TestRunnerMobile(_ui.workingFolderRunOnMobileLabel, _ui.connectDeviceButton, _ui.pullFolderButton, _ui.detectedDeviceLabel, _ui.folderLineEdit);
|
||||
}
|
||||
|
||||
void Nitpick::startTestsEvaluation(const bool isRunningFromCommandLine,
|
||||
|
|
|
@ -16,13 +16,22 @@
|
|||
#include "Nitpick.h"
|
||||
extern Nitpick* nitpick;
|
||||
|
||||
TestRunnerMobile::TestRunnerMobile(QLabel* workingFolderLabel, QPushButton *conectDeviceButton, QPushButton *pullFolderButton, QLabel* detectedDeviceLabel, QObject* parent)
|
||||
: QObject(parent)
|
||||
TestRunnerMobile::TestRunnerMobile(
|
||||
QLabel* workingFolderLabel,
|
||||
QPushButton *connectDeviceButton,
|
||||
QPushButton *pullFolderButton,
|
||||
QLabel* detectedDeviceLabel,
|
||||
QLineEdit *folderLineEdit,
|
||||
QObject* parent
|
||||
) : QObject(parent)
|
||||
{
|
||||
_workingFolderLabel = workingFolderLabel;
|
||||
_connectDeviceButton = conectDeviceButton;
|
||||
_connectDeviceButton = connectDeviceButton;
|
||||
_pullFolderButton = pullFolderButton;
|
||||
_detectedDeviceLabel = detectedDeviceLabel;
|
||||
_folderLineEdit = folderLineEdit;
|
||||
|
||||
folderLineEdit->setText("/sdcard/DCIM/TEST");
|
||||
}
|
||||
|
||||
TestRunnerMobile::~TestRunnerMobile() {
|
||||
|
@ -82,12 +91,14 @@ void TestRunnerMobile::connectDevice() {
|
|||
QMessageBox::critical(0, "Too many devices detected", "Tests will run only if a single device is attached");
|
||||
|
||||
} else {
|
||||
_pullFolderButton->setEnabled(true);
|
||||
_detectedDeviceLabel->setText(line2.remove(DEVICE));
|
||||
_pullFolderButton->setEnabled(true);
|
||||
_folderLineEdit->setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TestRunnerMobile::pullFolder() {
|
||||
QString command = _adbCommand + " devices > " + _workingFolder + "/devices.txt";
|
||||
QString command = _adbCommand + " pull " + _folderLineEdit->text() + " " + _workingFolder + " >" + _workingFolder + "/pullOutput.txt";
|
||||
int result = system(command.toStdString().c_str());
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#define hifi_testRunnerMobile_h
|
||||
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QObject>
|
||||
#include <QPushButton>
|
||||
|
||||
|
@ -20,7 +21,14 @@
|
|||
class TestRunnerMobile : public QObject, public TestRunner {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit TestRunnerMobile(QLabel* workingFolderLabel, QPushButton *connectDeviceButton, QPushButton *pullFolderButton, QLabel* detectedDeviceLabel, QObject* parent = 0);
|
||||
explicit TestRunnerMobile(
|
||||
QLabel* workingFolderLabel,
|
||||
QPushButton *connectDeviceButton,
|
||||
QPushButton *pullFolderButton,
|
||||
QLabel* detectedDeviceLabel,
|
||||
QLineEdit *folderLineEdit,
|
||||
QObject* parent = 0
|
||||
);
|
||||
~TestRunnerMobile();
|
||||
|
||||
void setWorkingFolderAndEnableControls();
|
||||
|
@ -32,6 +40,7 @@ private:
|
|||
QPushButton* _connectDeviceButton;
|
||||
QPushButton* _pullFolderButton;
|
||||
QLabel* _detectedDeviceLabel;
|
||||
QLineEdit* _folderLineEdit;
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
const QString _adbExe{ "adb.exe" };
|
||||
|
|
|
@ -623,6 +623,9 @@
|
|||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="folderLineEdit">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
|
|
Loading…
Reference in a new issue