60 << "-f, --portfriendlyname <substring> specify COM port to use by friendly name" << endl |
60 << "-f, --portfriendlyname <substring> specify COM port to use by friendly name" << endl |
61 << "-t, --timeout <milliseconds> terminate test if timeout occurs" << endl |
61 << "-t, --timeout <milliseconds> terminate test if timeout occurs" << endl |
62 << "-v, --verbose show debugging output" << endl |
62 << "-v, --verbose show debugging output" << endl |
63 << "-q, --quiet hide progress messages" << endl |
63 << "-q, --quiet hide progress messages" << endl |
64 << "-d, --download <remote file> <local file> copy file from phone to PC after running test" << endl |
64 << "-d, --download <remote file> <local file> copy file from phone to PC after running test" << endl |
|
65 << "--nocrashlog Don't capture call stack if test crashes" << endl |
|
66 << "--crashlogpath <dir> Path to save crash logs (default=working dir)" << endl |
65 << endl |
67 << endl |
66 << "USB COM ports can usually be autodetected, use -p or -f to force a specific port." << endl |
68 << "USB COM ports can usually be autodetected, use -p or -f to force a specific port." << endl |
67 << "If using System TRK, it is possible to copy the program directly to sys/bin on the phone." << endl |
69 << "If using System TRK, it is possible to copy the program directly to sys/bin on the phone." << endl |
68 << "-s can be used with both System and Application TRK to install the program" << endl; |
70 << "-s can be used with both System and Application TRK to install the program" << endl; |
69 } |
71 } |
143 } |
153 } |
144 |
154 |
145 if (serialPortName.isEmpty()) { |
155 if (serialPortName.isEmpty()) { |
146 if (loglevel > 0) |
156 if (loglevel > 0) |
147 outstream << "Detecting serial ports" << endl; |
157 outstream << "Detecting serial ports" << endl; |
148 foreach (const SerialPortId &id, enumerateSerialPorts()) { |
158 foreach (const SerialPortId &id, enumerateSerialPorts(loglevel)) { |
149 if (loglevel > 0) |
159 if (loglevel > 0) |
150 outstream << "Port Name: " << id.portName << ", " |
160 outstream << "Port Name: " << id.portName << ", " |
151 << "Friendly Name:" << id.friendlyName << endl; |
161 << "Friendly Name:" << id.friendlyName << endl; |
152 if (!id.friendlyName.isEmpty() |
162 if (!id.friendlyName.isEmpty() |
153 && serialPortFriendlyName.isEmpty() |
163 && serialPortFriendlyName.isEmpty() |
197 if (loglevel > 1) |
207 if (loglevel > 1) |
198 launcher->setVerbose(1); |
208 launcher->setVerbose(1); |
199 |
209 |
200 TrkSignalHandler handler; |
210 TrkSignalHandler handler; |
201 handler.setLogLevel(loglevel); |
211 handler.setLogLevel(loglevel); |
|
212 handler.setCrashLogging(crashlog); |
|
213 handler.setCrashLogPath(crashlogpath); |
202 |
214 |
203 QObject::connect(launcher.data(), SIGNAL(copyingStarted()), &handler, SLOT(copyingStarted())); |
215 QObject::connect(launcher.data(), SIGNAL(copyingStarted()), &handler, SLOT(copyingStarted())); |
204 QObject::connect(launcher.data(), SIGNAL(canNotConnect(const QString &)), &handler, SLOT(canNotConnect(const QString &))); |
216 QObject::connect(launcher.data(), SIGNAL(canNotConnect(const QString &)), &handler, SLOT(canNotConnect(const QString &))); |
205 QObject::connect(launcher.data(), SIGNAL(canNotCreateFile(const QString &, const QString &)), &handler, SLOT(canNotCreateFile(const QString &, const QString &))); |
217 QObject::connect(launcher.data(), SIGNAL(canNotCreateFile(const QString &, const QString &)), &handler, SLOT(canNotCreateFile(const QString &, const QString &))); |
206 QObject::connect(launcher.data(), SIGNAL(canNotWriteFile(const QString &, const QString &)), &handler, SLOT(canNotWriteFile(const QString &, const QString &))); |
218 QObject::connect(launcher.data(), SIGNAL(canNotWriteFile(const QString &, const QString &)), &handler, SLOT(canNotWriteFile(const QString &, const QString &))); |
213 QObject::connect(launcher.data(), SIGNAL(canNotRun(const QString &)), &handler, SLOT(canNotRun(const QString &))); |
225 QObject::connect(launcher.data(), SIGNAL(canNotRun(const QString &)), &handler, SLOT(canNotRun(const QString &))); |
214 QObject::connect(launcher.data(), SIGNAL(applicationOutputReceived(const QString &)), &handler, SLOT(applicationOutputReceived(const QString &))); |
226 QObject::connect(launcher.data(), SIGNAL(applicationOutputReceived(const QString &)), &handler, SLOT(applicationOutputReceived(const QString &))); |
215 QObject::connect(launcher.data(), SIGNAL(copyProgress(int)), &handler, SLOT(copyProgress(int))); |
227 QObject::connect(launcher.data(), SIGNAL(copyProgress(int)), &handler, SLOT(copyProgress(int))); |
216 QObject::connect(launcher.data(), SIGNAL(stateChanged(int)), &handler, SLOT(stateChanged(int))); |
228 QObject::connect(launcher.data(), SIGNAL(stateChanged(int)), &handler, SLOT(stateChanged(int))); |
217 QObject::connect(launcher.data(), SIGNAL(processStopped(uint,uint,uint,QString)), &handler, SLOT(stopped(uint,uint,uint,QString))); |
229 QObject::connect(launcher.data(), SIGNAL(processStopped(uint,uint,uint,QString)), &handler, SLOT(stopped(uint,uint,uint,QString))); |
|
230 QObject::connect(launcher.data(), SIGNAL(libraryLoaded(trk::Library)), &handler, SLOT(libraryLoaded(trk::Library))); |
|
231 QObject::connect(launcher.data(), SIGNAL(libraryUnloaded(trk::Library)), &handler, SLOT(libraryUnloaded(trk::Library))); |
|
232 QObject::connect(launcher.data(), SIGNAL(registersAndCallStackReadComplete(const QList<uint> &,const QByteArray &)), &handler, SLOT(registersAndCallStackReadComplete(const QList<uint> &,const QByteArray &))); |
218 QObject::connect(&handler, SIGNAL(resume(uint,uint)), launcher.data(), SLOT(resumeProcess(uint,uint))); |
233 QObject::connect(&handler, SIGNAL(resume(uint,uint)), launcher.data(), SLOT(resumeProcess(uint,uint))); |
219 QObject::connect(&handler, SIGNAL(terminate()), launcher.data(), SLOT(terminate())); |
234 QObject::connect(&handler, SIGNAL(terminate()), launcher.data(), SLOT(terminate())); |
|
235 QObject::connect(&handler, SIGNAL(getRegistersAndCallStack(uint,uint)), launcher.data(), SLOT(getRegistersAndCallStack(uint,uint))); |
220 QObject::connect(launcher.data(), SIGNAL(finished()), &handler, SLOT(finished())); |
236 QObject::connect(launcher.data(), SIGNAL(finished()), &handler, SLOT(finished())); |
221 |
237 |
222 QTimer timer; |
238 QTimer timer; |
223 timer.setSingleShot(true); |
239 timer.setSingleShot(true); |
224 QObject::connect(&timer, SIGNAL(timeout()), &handler, SLOT(timeout())); |
240 QObject::connect(&timer, SIGNAL(timeout()), &handler, SLOT(timeout())); |