diff options
author | Martin Storsjo <martin@martin.st> | 2011-06-24 13:00:29 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-06-24 13:00:29 (GMT) |
commit | 37a21edbfb01f902bbfc033727066ed1ee1354e7 (patch) | |
tree | dfa63d4cee7bf39d54bf0b311414778e13004eec /tools/runonphone | |
parent | 75c04d43cc8264f142d26f9524b325dbc362cae5 (diff) | |
download | Qt-37a21edbfb01f902bbfc033727066ed1ee1354e7.zip Qt-37a21edbfb01f902bbfc033727066ed1ee1354e7.tar.gz Qt-37a21edbfb01f902bbfc033727066ed1ee1354e7.tar.bz2 |
runonphone: Change the upload option to allow uploading any file
This allows uploading of any file to any directory on the phone.
Merge-request: 1271
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'tools/runonphone')
-rw-r--r-- | tools/runonphone/main.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/runonphone/main.cpp b/tools/runonphone/main.cpp index e400062..d749106 100644 --- a/tools/runonphone/main.cpp +++ b/tools/runonphone/main.cpp @@ -62,7 +62,7 @@ void printUsage(QTextStream& outstream, QString exeName) << "-t, --timeout <milliseconds> terminate test if timeout occurs" << endl << "-v, --verbose show debugging output" << endl << "-q, --quiet hide progress messages" << endl - << "-u, --upload <local file> upload executable file to phone" << endl + << "-u, --upload <local file> <remote file> upload file to phone" << endl << "-d, --download <remote file> <local file> copy file from phone to PC after running test" << endl << "--nocrashlog Don't capture call stack if test crashes" << endl << "--crashlogpath <dir> Path to save crash logs (default=working dir)" << endl @@ -86,6 +86,7 @@ int main(int argc, char *argv[]) QTextStream outstream(stdout); QTextStream errstream(stderr); QString uploadLocalFile; + QString uploadRemoteFile; QString downloadRemoteFile; QString downloadLocalFile; int loglevel=1; @@ -121,10 +122,8 @@ int main(int argc, char *argv[]) errstream << "Executable file (" << uploadLocalFile << ") doesn't exist" << endl; return 1; } - if (!(QFileInfo(uploadLocalFile).suffix() == "exe")) { - errstream << "File (" << uploadLocalFile << ") must be an executable" << endl; - return 1; - } + CHECK_PARAMETER_EXISTS + uploadRemoteFile = it.next(); } else if (arg == "--download" || arg == "-d") { CHECK_PARAMETER_EXISTS @@ -161,7 +160,8 @@ int main(int argc, char *argv[]) } } - if (exeFile.isEmpty() && sisFile.isEmpty() && uploadLocalFile.isEmpty() && + if (exeFile.isEmpty() && sisFile.isEmpty() && + (uploadLocalFile.isEmpty() || uploadRemoteFile.isEmpty()) && (downloadLocalFile.isEmpty() || downloadRemoteFile.isEmpty())) { printUsage(outstream, args[0]); return 1; @@ -211,7 +211,7 @@ int main(int argc, char *argv[]) } else if (!uploadLocalFile.isEmpty() && uploadInfo.exists()) { launcher->addStartupActions(trk::Launcher::ActionCopy); - launcher->setCopyFileName(uploadLocalFile, QString("c:\\sys\\bin\\") + uploadInfo.fileName()); + launcher->setCopyFileName(uploadLocalFile, uploadRemoteFile); } if (!exeFile.isEmpty()) { launcher->addStartupActions(trk::Launcher::ActionRun); |