summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-01-06 08:55:46 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-01-06 08:55:46 (GMT)
commitb0fd5e82c0d7d62a01cce2c1cdcb925bc5a34182 (patch)
treeca684ffa4016676edcd9fde83d99ed8242147e4e
parent4c486619517cea4012a157995bce197c817d83e5 (diff)
parent66275bc468339ec2599ba660b728304858e30b39 (diff)
downloadQt-b0fd5e82c0d7d62a01cce2c1cdcb925bc5a34182.zip
Qt-b0fd5e82c0d7d62a01cce2c1cdcb925bc5a34182.tar.gz
Qt-b0fd5e82c0d7d62a01cce2c1cdcb925bc5a34182.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public: Fixed Symbian application deployment instructions Fixed "run" makefile target documentation for Symbian Minor logic fix to Symbian generator in qmake Deal with test cases that crash or hang Updated sis file names and related content in Symbian installation docs
-rw-r--r--doc/src/deployment/deployment.qdoc4
-rw-r--r--doc/src/getting-started/installation.qdoc43
-rw-r--r--doc/src/platforms/symbian-introduction.qdoc7
-rw-r--r--doc/src/snippets/code/doc_src_deployment.qdoc6
-rw-r--r--doc/src/snippets/code/doc_src_installation.qdoc2
-rw-r--r--qmake/generators/symbian/symmake.cpp13
-rw-r--r--tools/runonphone/main.cpp82
-rw-r--r--tools/runonphone/trk/launcher.cpp20
-rw-r--r--tools/runonphone/trk/launcher.h2
-rw-r--r--tools/runonphone/trksignalhandler.cpp98
-rw-r--r--tools/runonphone/trksignalhandler.h12
11 files changed, 229 insertions, 60 deletions
diff --git a/doc/src/deployment/deployment.qdoc b/doc/src/deployment/deployment.qdoc
index 6a1760e..f2038b2 100644
--- a/doc/src/deployment/deployment.qdoc
+++ b/doc/src/deployment/deployment.qdoc
@@ -1567,12 +1567,12 @@
By default \c .pkg file generated by \c qmake adds support for all
S60 3rd edition FP1, S60 3rd edition FP2 and S60 5th edition devices.
- As a last step we will embed the Open C, Open C++ and Qt \c .sis files to the Wiggly
+ As a last step we will embed the \c qt_installer.sis file to the Wiggly
deployment file:
\snippet doc/src/snippets/code/doc_src_deployment.qdoc 58
- By embedding all dependencies to the application deployment file, the
+ When \c qt_installer.sis is embedded to the application deployment file, the
end-user does not need to download and install all dependencies separately.
The drawback of \c .sis embedding is that the application \c .sis file size becomes
big. To address these problems Forum Nokia is planning to release a smart installer
diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc
index b052c3c..73d3709 100644
--- a/doc/src/getting-started/installation.qdoc
+++ b/doc/src/getting-started/installation.qdoc
@@ -511,19 +511,27 @@ in the \l{Qt for the Symbian platform Requirements} document.
\note Qt must be installed on the same drive as the Symbian SDK you are
using, and the install path must not contain any spaces.
+ \o Install Qt into a device
+
+ To run Qt applications on a device, \c{qt_installer.sis} found
+ in the Qt installation directory must be first installed into the device.
+ \c{Qt_installer.sis} contains Qt libraries and Open C libraries all in one
+ convenient package.
+ Begin installation by connecting your device via USB cable to a computer that
+ has the \l{http://www.nokia.com/pcsuite}{Nokia PC Suite} installed.
+ On the device, select "PC Suite mode". In Windows Explorer right click
+ on the \c{qt_installer.sis} file, select "Install with Nokia Application
+ Installer" and follow the instructions.
+
\o Running Qt demos
We've included a subset of the Qt demos in this package for you
to try out. An excellent starting point is the "fluidlauncher"
- demo. To run the demo on a real device, you first have to install
- \c{qt.sis} and \c{fluidlauncher.sis} found in the Qt installation
- directory. Also, check if the device needs additional
- \l{Qt for the Symbian platform Requirements}{requirements}.
- Begin by connecting your device via USB cable to a computer that has
- the \l{http://www.nokia.com/pcsuite}{Nokia PC Suite} installed.
- On the device, select "PC Suite mode". In Windows Explorer right click
- on the \c{.sis} files, select "Install with Nokia Application Installer"
- and follow the instructions.
+ demo.
+
+ To run the demo on a real device, install \c{fluidlauncher.sis}
+ found in the Qt installation directory to a device that already has Qt installed.
+ After installation, you can find fluidlauncher in the applications folder of the device.
To run the demos and examples on the emulator, you need to build them first.
Open the "Qt for the Symbian platform Command Prompt" from the Start menu and type:
@@ -1013,15 +1021,26 @@ If you are using pre-built binaries, follow the instructions given in the
which is not available free of charge.
\endlist
- Running Qt on real device requires the following packages to be installed on your device.
- The packages can be found in the Symbian SDK where you installed Open C/C++:
+ Running Qt on real device requires the Open C to be installed on the device.
+ The Open C installation packages are embedded into \c{qt_installer.sis}, which is included in
+ Qt for Symbian binary package. If you are building Qt from scratch, you can find the
+ required packages in the Symbian SDK where you installed Open C/C++:
\list
\o \c{nokia_plugin\openc\s60opencsis\pips_s60_<version>.sis}
\o \c{nokia_plugin\openc\s60opencsis\openc_ssl_s60_<version>.sis}
\o \c{nokia_plugin\opencpp\s60opencppsis\stdcpp_s60_<version>.sis}
\endlist
- We recommend you to take a look of \l{http://developer.symbian.org/wiki/index.php/Qt_Quick_Start}{Symbian Foundation - Qt Quick Start}
+ If you wish to do hardware debugging with Carbide or run applications in real devices using "make run" command,
+ TRK must be installed to the device. \bold{Note:} TRK is not required if you just want to install and run
+ applications manually on the device.
+ \list
+ \o \l{http://tools.ext.nokia.com/trk/}{Application TRK}. Choose the correct
+ installation package based on the S60 version of your device (S60_<S60-version>_app_trk_<TRK-version>.sisx).
+ \endlist
+
+
+ We recommend you to take a look at \l{http://developer.symbian.org/wiki/index.php/Qt_Quick_Start}{Symbian Foundation - Qt Quick Start}
to get more information about how to setup the development environment.
\sa {Known Issues in %VERSION%}
diff --git a/doc/src/platforms/symbian-introduction.qdoc b/doc/src/platforms/symbian-introduction.qdoc
index c0c4fb3..477e629 100644
--- a/doc/src/platforms/symbian-introduction.qdoc
+++ b/doc/src/platforms/symbian-introduction.qdoc
@@ -124,7 +124,12 @@
\row \o \c release-gcce \o Build release binaries for hardware using GCCE.
\row \o \c debug-armv5 \o Build debug binaries for hardware using RVCT.
\row \o \c release-armv5 \o Build release binaries for hardware using RVCT.
- \row \o \c run \o Run the emulator binaries from the build directory.
+ \row \o \c run \o Run the application. Environment variable
+ \c QT_SIS_TARGET (see below) can be used to specify which
+ build target is run. By default it is the last build target.
+ Note that running the application on real device
+ using this command requires \c TRK application to be running
+ on the device.
\row \o \c sis \o Create signed \c .sis file for project.
\endtable
diff --git a/doc/src/snippets/code/doc_src_deployment.qdoc b/doc/src/snippets/code/doc_src_deployment.qdoc
index 2d6a78f..8211abe 100644
--- a/doc/src/snippets/code/doc_src_deployment.qdoc
+++ b/doc/src/snippets/code/doc_src_deployment.qdoc
@@ -476,12 +476,8 @@ default_deployment.pkg_prerules += supported_platforms
//! [58]
embedded_deployments = \
- "; Embed Open C dependencies" \
- "@\"$${EPOCROOT}nokia_plugin/openc/s60opencsis/pips_s60_1_6_SS.sis\",(0x20013851)" \
- "@\"$${EPOCROOT}nokia_plugin/openc/s60opencsis/openc_ssl_s60_1_6_SS.sis\",(0x200110CB)" \
- "@\"$${EPOCROOT}nokia_plugin/opencpp/s60opencppsis/STDCPP_s60_1_6_SS.sis\",(0x2000F866)" \
"; Embed Qt dependencies" \
- "@\"$$[QT_INSTALL_PREFIX]/qt_rndsigned.sis\",(0x2001E61C)"
+ "@\"$$[QT_INSTALL_PREFIX]/qt_installer.sis\",(0x2001E62D)"
default_deployment.pkg_prerules += embedded_deployments
//! [58]
diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc
index c810706..bc61702 100644
--- a/doc/src/snippets/code/doc_src_installation.qdoc
+++ b/doc/src/snippets/code/doc_src_installation.qdoc
@@ -198,6 +198,8 @@ make release-armv5
//! [29]
cd src\s60installs
make sis QT_SIS_OPTIONS=-i QT_SIS_CERTIFICATE=<certificate file> QT_SIS_KEY=<certificate key file>
+cd ..\3rdparty\webkit\WebCore
+make sis QT_SIS_OPTIONS=-i QT_SIS_CERTIFICATE=<certificate file> QT_SIS_KEY=<certificate key file>
//! [29]
//! [30]
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index ddda848..b2709d1 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -91,7 +91,6 @@
#define OK_SIS_TARGET "ok_sis"
#define FAIL_SIS_NOPKG_TARGET "fail_sis_nopkg"
#define FAIL_SIS_NOCACHE_TARGET "fail_sis_nocache"
-#define RESTORE_BUILD_TARGET "restore_build"
#define PRINT_FILE_CREATE_ERROR(filename) fprintf(stderr, "Error: Could not create '%s'\n", qPrintable(filename));
@@ -1762,7 +1761,10 @@ void SymbianMakefileGenerator::removeSpecialCharacters(QString& str)
void SymbianMakefileGenerator::writeSisTargets(QTextStream &t)
{
- t << SIS_TARGET ": " RESTORE_BUILD_TARGET << endl;
+ t << "-include " MAKE_CACHE_NAME << endl;
+ t << endl;
+
+ t << SIS_TARGET ":" << endl;
QString siscommand = QString("\t$(if $(wildcard %1_template.%2),$(if $(wildcard %3)," \
"$(MAKE) -s -f $(MAKEFILE) %4," \
"$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) %4," \
@@ -1793,11 +1795,6 @@ void SymbianMakefileGenerator::writeSisTargets(QTextStream &t)
t << FAIL_SIS_NOCACHE_TARGET ":" << endl;
t << "\t$(error Project has to be built or QT_SIS_TARGET environment variable has to be set before calling 'SIS' target)" << endl;
t << endl;
-
-
- t << RESTORE_BUILD_TARGET ":" << endl;
- t << "-include " MAKE_CACHE_NAME << endl;
- t << endl;
}
void SymbianMakefileGenerator::generateDistcleanTargets(QTextStream& t)
@@ -1866,7 +1863,7 @@ void SymbianMakefileGenerator::generateExecutionTargets(QTextStream& t, const QS
t << "else" << endl;
}
t << "run: sis" << endl;
- t << "\trunonphone --sis " << fixedTarget << "_$(QT_SIS_TARGET).sis " << fixedTarget << ".exe " << "$(QT_RUN_OPTIONS)" << endl;
+ t << "\trunonphone $(QT_RUN_ON_PHONE_OPTIONS) --sis " << fixedTarget << "_$(QT_SIS_TARGET).sis " << fixedTarget << ".exe " << "$(QT_RUN_OPTIONS)" << endl;
if (platforms.contains("winscw")) {
t << "endif" << endl;
}
diff --git a/tools/runonphone/main.cpp b/tools/runonphone/main.cpp
index 58d8c3b..e2f6758 100644
--- a/tools/runonphone/main.cpp
+++ b/tools/runonphone/main.cpp
@@ -40,9 +40,10 @@
****************************************************************************/
#include <QCoreApplication>
-#include <QDebug>
+#include <QTextStream>
#include <QStringList>
#include <QScopedPointer>
+#include <QTimer>
#include "trkutils.h"
#include "trkdevice.h"
#include "launcher.h"
@@ -50,12 +51,15 @@
#include "trksignalhandler.h"
#include "serenum.h"
-void printUsage()
+void printUsage(QTextStream& outstream)
{
- qDebug() << "runtest [options] <program> [program arguments]" << endl
+ outstream << "runtest [options] <program> [program arguments]" << endl
<< "-s, --sis <file> specify sis file to install" << endl
<< "-p, --portname <COMx> specify COM port to use by device name" << endl
<< "-f, --portfriendlyname <substring> specify COM port to use by friendly name" << endl
+ << "-t, --timeout <milliseconds> terminate test if timeout occurs" << endl
+ << "-v, --verbose show debugging output" << endl
+ << "-q, --quiet hide progress messages" << endl
<< endl
<< "USB COM ports can usually be autodetected" << endl;
}
@@ -70,26 +74,51 @@ int main(int argc, char *argv[])
QString exeFile;
QString cmdLine;
QStringList args = QCoreApplication::arguments();
+ QTextStream outstream(stdout);
+ QTextStream errstream(stderr);
+ int loglevel=1;
+ int timeout=0;
for (int i=1;i<args.size();i++) {
QString arg = args.at(i);
if (arg.startsWith("-")) {
if (args.size() < i+2) {
- qWarning("Command line missing argument parameters");
+ errstream << "Command line missing argument parameters" << endl;
return 1;
}
- i++;
- QString param = args.at(i);
+ QString param = args.at(i+1);
if(arg.compare("--portname", Qt::CaseSensitive) == 0
- || arg.compare("-p", Qt::CaseSensitive) == 0)
+ || arg.compare("-p", Qt::CaseSensitive) == 0) {
serialPortName = param;
+ i++;
+ }
else if(arg.compare("--portfriendlyname", Qt::CaseSensitive) == 0
- || arg.compare("-f", Qt::CaseSensitive) == 0)
+ || arg.compare("-f", Qt::CaseSensitive) == 0) {
serialPortFriendlyName = param;
+ i++;
+ }
else if(arg.compare("--sis", Qt::CaseSensitive) == 0
- || arg.compare("-s", Qt::CaseSensitive) == 0)
+ || arg.compare("-s", Qt::CaseSensitive) == 0) {
sisFile = param;
+ i++;
+ }
+ else if(arg.compare("--timeout", Qt::CaseSensitive) == 0
+ || arg.compare("-t", Qt::CaseSensitive) == 0) {
+ bool ok;
+ timeout = param.toInt(&ok);
+ if (!ok) {
+ errstream << "Timeout must be specified in milliseconds" << endl;
+ return 1;
+ }
+ i++;
+ }
+ else if(arg.compare("--verbose", Qt::CaseSensitive) == 0
+ || arg.compare("-v", Qt::CaseSensitive) == 0)
+ loglevel=2;
+ else if(arg.compare("--quiet", Qt::CaseSensitive) == 0
+ || arg.compare("-q", Qt::CaseSensitive) == 0)
+ loglevel=0;
else
- qWarning() << "unknown command line option " << arg;
+ errstream << "unknown command line option " << arg << endl;
} else {
exeFile = arg;
i++;
@@ -101,23 +130,27 @@ int main(int argc, char *argv[])
}
if(exeFile.isEmpty()) {
- printUsage();
+ printUsage(outstream);
return 1;
}
if(serialPortName.isEmpty()) {
- qDebug() << "Detecting serial ports" << endl;
+ if(loglevel > 0)
+ outstream << "Detecting serial ports" << endl;
QList <SerialPortId> ports = enumerateSerialPorts();
foreach(SerialPortId id, ports) {
- qDebug() << "Port Name: " << id.portName << ", "
+ if(loglevel > 0)
+ outstream << "Port Name: " << id.portName << ", "
<< "Friendly Name:" << id.friendlyName << endl;
if(serialPortName.isEmpty()) {
- if(id.friendlyName.isEmpty() &&
+ if(!id.friendlyName.isEmpty() &&
+ serialPortFriendlyName.isEmpty() &&
(id.friendlyName.contains("symbian", Qt::CaseInsensitive) ||
id.friendlyName.contains("s60", Qt::CaseInsensitive) ||
id.friendlyName.contains("nokia", Qt::CaseInsensitive)))
serialPortName = id.portName;
else if (!id.friendlyName.isEmpty() &&
+ !serialPortFriendlyName.isEmpty() &&
id.friendlyName.contains(serialPortFriendlyName))
serialPortName = id.portName;
}
@@ -129,20 +162,25 @@ int main(int argc, char *argv[])
if(sisFile.isEmpty()) {
launcher.reset(new trk::Launcher(trk::Launcher::ActionCopyRun));
launcher->setCopyFileName(exeFile, QString("c:\\sys\\bin\\") + exeFile);
- qDebug() << "System TRK required to copy EXE, use --sis if using Application TRK" << endl;
+ errstream << "System TRK required to copy EXE, use --sis if using Application TRK" << endl;
} else {
launcher.reset(new trk::Launcher(trk::Launcher::ActionCopyInstallRun));
launcher->addStartupActions(trk::Launcher::ActionInstall);
launcher->setCopyFileName(sisFile, "c:\\data\\testtemp.sis");
launcher->setInstallFileName("c:\\data\\testtemp.sis");
}
- qDebug() << "Connecting to target via " << serialPortName << endl;
+ if(loglevel > 0)
+ outstream << "Connecting to target via " << serialPortName << endl;
launcher->setTrkServerName(QString("\\\\.\\") + serialPortName);
launcher->setFileName(QString("c:\\sys\\bin\\") + exeFile);
launcher->setCommandLineArgs(cmdLine);
+ if(loglevel > 1)
+ launcher->setVerbose(1);
+
TrkSignalHandler handler;
+ handler.setLogLevel(loglevel);
QObject::connect(launcher.data(), SIGNAL(copyingStarted()), &handler, SLOT(copyingStarted()));
QObject::connect(launcher.data(), SIGNAL(canNotConnect(const QString &)), &handler, SLOT(canNotConnect(const QString &)));
@@ -158,11 +196,21 @@ int main(int argc, char *argv[])
QObject::connect(launcher.data(), SIGNAL(applicationOutputReceived(const QString &)), &handler, SLOT(applicationOutputReceived(const QString &)));
QObject::connect(launcher.data(), SIGNAL(copyProgress(int)), &handler, SLOT(copyProgress(int)));
QObject::connect(launcher.data(), SIGNAL(stateChanged(int)), &handler, SLOT(stateChanged(int)));
+ QObject::connect(launcher.data(), SIGNAL(stopped(uint,uint,uint,QString)), &handler, SLOT(stopped(uint,uint,uint,QString)));
+ QObject::connect(&handler, SIGNAL(resume(uint,uint)), launcher.data(), SLOT(resume(uint,uint)));
+ QObject::connect(&handler, SIGNAL(terminate()), launcher.data(), SLOT(terminate()));
QObject::connect(launcher.data(), SIGNAL(finished()), &handler, SLOT(finished()));
+ QTimer timer;
+ timer.setSingleShot(true);
+ QObject::connect(&timer, SIGNAL(timeout()), &handler, SLOT(timeout()));
+ if (timeout > 0) {
+ timer.start(timeout);
+ }
+
QString errorMessage;
if(!launcher->startServer(&errorMessage)) {
- qWarning() << errorMessage;
+ errstream << errorMessage << endl;
return 1;
}
diff --git a/tools/runonphone/trk/launcher.cpp b/tools/runonphone/trk/launcher.cpp
index 90ad602..a5d173a 100644
--- a/tools/runonphone/trk/launcher.cpp
+++ b/tools/runonphone/trk/launcher.cpp
@@ -317,6 +317,18 @@ void Launcher::handleResult(const TrkResult &result)
case TrkNotifyStopped: { // Notified Stopped
logMessage(prefix + "NOTE: STOPPED " + str);
// 90 01 78 6a 40 40 00 00 07 23 00 00 07 24 00 00
+ QString reason;
+ if (result.data.size() >= 14) {
+ uint pc = extractInt(result.data.mid(0,4).constData());
+ uint pid = extractInt(result.data.mid(4,4).constData());
+ uint tid = extractInt(result.data.mid(8,4).constData());
+ ushort len = extractShort(result.data.mid(12,2).constData());
+ if(len > 0)
+ reason = result.data.mid(14, len);
+ emit(stopped(pc, pid, tid, reason));
+ } else {
+ emit(stopped(0, 0, 0, reason));
+ }
//const char *data = result.data.data();
// uint addr = extractInt(data); //code address: 4 bytes; code base address for the library
// uint pid = extractInt(data + 4); // ProcessID: 4 bytes;
@@ -692,4 +704,12 @@ void Launcher::startInferiorIfNeeded()
}
d->m_device->sendTrkMessage(TrkCreateItem, TrkCallback(this, &Launcher::handleCreateProcess), ba); // Create Item
}
+
+void Launcher::resume(uint pid, uint tid)
+{
+ QByteArray ba;
+ appendInt(&ba, pid, BigEndian);
+ appendInt(&ba, tid, BigEndian);
+ d->m_device->sendTrkMessage(TrkContinue, TrkCallback(), ba, "CONTINUE");
+}
} // namespace trk
diff --git a/tools/runonphone/trk/launcher.h b/tools/runonphone/trk/launcher.h
index 29ee967..3a0c3ef 100644
--- a/tools/runonphone/trk/launcher.h
+++ b/tools/runonphone/trk/launcher.h
@@ -125,9 +125,11 @@ signals:
void applicationOutputReceived(const QString &output);
void copyProgress(int percent);
void stateChanged(int);
+ void stopped(uint pc, uint pid, uint tid, const QString& reason);
public slots:
void terminate();
+ void resume(uint pid, uint tid);
private slots:
void handleResult(const trk::TrkResult &data);
diff --git a/tools/runonphone/trksignalhandler.cpp b/tools/runonphone/trksignalhandler.cpp
index afb1918..099be7a 100644
--- a/tools/runonphone/trksignalhandler.cpp
+++ b/tools/runonphone/trksignalhandler.cpp
@@ -41,81 +41,149 @@
#include <QDebug>
#include <QCoreApplication>
+#include <QObject>
#include "trksignalhandler.h"
+class TrkSignalHandlerPrivate
+{
+ friend class TrkSignalHandler;
+public:
+ TrkSignalHandlerPrivate();
+ ~TrkSignalHandlerPrivate();
+private:
+ QTextStream out;
+ QTextStream err;
+ int loglevel;
+};
+
void TrkSignalHandler::copyingStarted()
{
- qDebug() << "Copying...\n";
+ if(d->loglevel > 0)
+ d->out << "Copying..." << endl;
}
void TrkSignalHandler::canNotConnect(const QString &errorMessage)
{
- qWarning() << "Cannot Connect - " << errorMessage;
+ d->err << "Cannot Connect - " << errorMessage << endl;
}
void TrkSignalHandler::canNotCreateFile(const QString &filename, const QString &errorMessage)
{
- qWarning() << "Cannot create file (" << filename << ") - " << errorMessage << "\n";
+ d->err << "Cannot create file (" << filename << ") - " << errorMessage << endl;
}
void TrkSignalHandler::canNotWriteFile(const QString &filename, const QString &errorMessage)
{
- qWarning() << "Cannot write file (" << filename << ") - " << errorMessage << "\n";
+ d->err << "Cannot write file (" << filename << ") - " << errorMessage << endl;
}
void TrkSignalHandler::canNotCloseFile(const QString &filename, const QString &errorMessage)
{
- qWarning() << "Cannot close file (" << filename << ") - " << errorMessage << "\n";
+ d->err << "Cannot close file (" << filename << ") - " << errorMessage << endl;
}
void TrkSignalHandler::installingStarted()
{
- qDebug() << "Installing...\n";
+ if(d->loglevel > 0)
+ d->out << "Installing..." << endl;
}
void TrkSignalHandler::canNotInstall(const QString &packageFilename, const QString &errorMessage)
{
- qWarning() << "Cannot install file (" << packageFilename << ") - " << errorMessage << "\n";
+ d->err << "Cannot install file (" << packageFilename << ") - " << errorMessage << endl;
}
void TrkSignalHandler::installingFinished()
{
- qDebug() << "Installing finished\n";
+ if(d->loglevel > 0)
+ d->out << "Installing finished" << endl;
}
void TrkSignalHandler::startingApplication()
{
- qDebug() << "Starting app...\n";
+ if(d->loglevel > 0)
+ d->out << "Starting app..." << endl;
}
void TrkSignalHandler::applicationRunning(uint pid)
{
- qDebug() << "Running...\n";
+ if(d->loglevel > 0)
+ d->out << "Running..." << endl;
}
void TrkSignalHandler::canNotRun(const QString &errorMessage)
{
- qWarning() << "Cannot run - " << errorMessage << "\n";
+ d->err << "Cannot run - " << errorMessage << endl;
}
void TrkSignalHandler::finished()
{
- qDebug() << "Done.\n";
+ if(d->loglevel > 0)
+ d->out << "Done." << endl;
QCoreApplication::quit();
}
void TrkSignalHandler::applicationOutputReceived(const QString &output)
{
- qDebug() << "> " << output;
+ d->out << output;
}
void TrkSignalHandler::copyProgress(int percent)
{
- qDebug() << percent << "%";
+ if(d->loglevel > 0) {
+ d->out << percent << "% ";
+ d->out.flush();
+ if(percent==100)
+ d->out << endl;
+ }
}
void TrkSignalHandler::stateChanged(int state)
{
- qDebug() << "State" << state;
+ if(d->loglevel > 1)
+ d->out << "State" << state << endl;
+}
+
+void TrkSignalHandler::setLogLevel(int level)
+{
+ d->loglevel = level;
+}
+
+void TrkSignalHandler::stopped(uint pc, uint pid, uint tid, const QString& reason)
+{
+ d->err << "STOPPED: pc=" << hex << pc << " pid=" << pid
+ << " tid=" << tid << dec << " - " << reason << endl;
+ // if it was a breakpoint, then we could continue with "emit resume(pid, tid);"
+ // since we have set no breakpoints, it will be a just in time debug of a panic / exception
+ emit terminate();
+}
+
+void TrkSignalHandler::timeout()
+{
+ d->err << "FAILED: stopping test due to timeout" << endl;
+ emit terminate();
}
+TrkSignalHandlerPrivate::TrkSignalHandlerPrivate() :
+ out(stdout),
+ err(stderr),
+ loglevel(0)
+{
+
+}
+
+TrkSignalHandlerPrivate::~TrkSignalHandlerPrivate()
+{
+ out.flush();
+ err.flush();
+}
+
+TrkSignalHandler::TrkSignalHandler()
+{
+ d = new TrkSignalHandlerPrivate();
+}
+
+TrkSignalHandler::~TrkSignalHandler()
+{
+ delete d;
+}
diff --git a/tools/runonphone/trksignalhandler.h b/tools/runonphone/trksignalhandler.h
index 2b3f3a0..818aa56 100644
--- a/tools/runonphone/trksignalhandler.h
+++ b/tools/runonphone/trksignalhandler.h
@@ -44,6 +44,7 @@
#include <QObject>
#include <QString>
+class TrkSignalHandlerPrivate;
class TrkSignalHandler : public QObject
{
Q_OBJECT
@@ -63,6 +64,17 @@ public slots:
void applicationOutputReceived(const QString &output);
void copyProgress(int percent);
void stateChanged(int);
+ void stopped(uint pc, uint pid, uint tid, const QString& reason);
+ void timeout();
+signals:
+ void resume(uint pid, uint tid);
+ void terminate();
+public:
+ TrkSignalHandler();
+ ~TrkSignalHandler();
+ void setLogLevel(int);
+private:
+ TrkSignalHandlerPrivate *d;
};
#endif // TRKSIGNALHANDLER_H