qprocess.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qprocess.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11QStringList QProcessEnvironmentPrivate::toList() const-
12{-
13 QStringList result;-
14 result.reserve(hash.size());-
15 for (Hash::const_iterator it = hash.cbegin(), end = hash.cend(); it != end; ++it)-
16 result << nameToString(it.key()) + QLatin1Char('=') + valueToString(it.value());-
17 return result;-
18}-
19-
20QProcessEnvironment QProcessEnvironmentPrivate::fromList(const QStringList &list)-
21{-
22 QProcessEnvironment env;-
23 QStringList::ConstIterator it = list.constBegin(),-
24 end = list.constEnd();-
25 for ( ; it != end; ++it) {-
26 int pos = it->indexOf(QLatin1Char('='), 1);-
27 if (pos < 1)-
28 continue;-
29-
30 QString value = it->mid(pos + 1);-
31 QString name = *it;-
32 name.truncate(pos);-
33 env.insert(name, value);-
34 }-
35 return env;-
36}-
37-
38QStringList QProcessEnvironmentPrivate::keys() const-
39{-
40 QStringList result;-
41 result.reserve(hash.size());-
42 Hash::ConstIterator it = hash.constBegin(),-
43 end = hash.constEnd();-
44 for ( ; it != end; ++it)-
45 result << nameToString(it.key());-
46 return result;-
47}-
48-
49void QProcessEnvironmentPrivate::insert(const QProcessEnvironmentPrivate &other)-
50{-
51 Hash::ConstIterator it = other.hash.constBegin(),-
52 end = other.hash.constEnd();-
53 for ( ; it != end; ++it)-
54 hash.insert(it.key(), it.value());-
55-
56-
57 QHash<QString, Key>::ConstIterator nit = other.nameMap.constBegin(),-
58 nend = other.nameMap.constEnd();-
59 for ( ; nit != nend; ++nit)-
60 nameMap.insert(nit.key(), nit.value());-
61-
62}-
63-
64-
65-
66-
67-
68-
69QProcessEnvironment::QProcessEnvironment()-
70 : d(0)-
71{-
72}-
73-
74-
75-
76-
77QProcessEnvironment::~QProcessEnvironment()-
78{-
79}-
80-
81-
82-
83-
84QProcessEnvironment::QProcessEnvironment(const QProcessEnvironment &other)-
85 : d(other.d)-
86{-
87}-
88-
89-
90-
91-
92-
93QProcessEnvironment &QProcessEnvironment::operator=(const QProcessEnvironment &other)-
94{-
95 d = other.d;-
96 return *this;-
97}-
98bool QProcessEnvironment::operator==(const QProcessEnvironment &other) const-
99{-
100 if (d == other.d)-
101 return true;-
102 if (d) {-
103 if (other.d) {-
104 QProcessEnvironmentPrivate::OrderedMutexLocker locker(d, other.d);-
105 return d->hash == other.d->hash;-
106 } else {-
107 return isEmpty();-
108 }-
109 } else {-
110 return other.isEmpty();-
111 }-
112}-
113-
114-
115-
116-
117-
118-
119-
120bool QProcessEnvironment::isEmpty() const-
121{-
122-
123 return d ? d->hash.isEmpty() : true;-
124}-
125-
126-
127-
128-
129-
130-
131-
132void QProcessEnvironment::clear()-
133{-
134 if (d)-
135 d->hash.clear();-
136-
137-
138}-
139bool QProcessEnvironment::contains(const QString &name) const-
140{-
141 if (!d)-
142 return false;-
143 QProcessEnvironmentPrivate::MutexLocker locker(d);-
144 return d->hash.contains(d->prepareName(name));-
145}-
146void QProcessEnvironment::insert(const QString &name, const QString &value)-
147{-
148-
149 d.detach();-
150 d->hash.insert(d->prepareName(name), d->prepareValue(value));-
151}-
152void QProcessEnvironment::remove(const QString &name)-
153{-
154 if (d) {-
155 d.detach();-
156 d->hash.remove(d->prepareName(name));-
157 }-
158}-
159QString QProcessEnvironment::value(const QString &name, const QString &defaultValue) const-
160{-
161 if (!d)-
162 return defaultValue;-
163-
164 QProcessEnvironmentPrivate::MutexLocker locker(d);-
165 QProcessEnvironmentPrivate::Hash::ConstIterator it = d->hash.constFind(d->prepareName(name));-
166 if (it == d->hash.constEnd())-
167 return defaultValue;-
168-
169 return d->valueToString(it.value());-
170}-
171QStringList QProcessEnvironment::toStringList() const-
172{-
173 if (!d)-
174 return QStringList();-
175 QProcessEnvironmentPrivate::MutexLocker locker(d);-
176 return d->toList();-
177}-
178-
179-
180-
181-
182-
183-
184-
185QStringList QProcessEnvironment::keys() const-
186{-
187 if (!d)-
188 return QStringList();-
189 QProcessEnvironmentPrivate::MutexLocker locker(d);-
190 return d->keys();-
191}-
192void QProcessEnvironment::insert(const QProcessEnvironment &e)-
193{-
194 if (!e.d)-
195 return;-
196-
197-
198 QProcessEnvironmentPrivate::MutexLocker locker(e.d);-
199 d->insert(*e.d);-
200}-
201-
202void QProcessPrivate::Channel::clear()-
203{-
204 switch (type) {-
205 case PipeSource:-
206 ((!(process)) ? qt_assert("process",__FILE__,438440) : qt_noop());-
207 process->stdinChannel.type = Normal;-
208 process->stdinChannel.process = 0;-
209 break;-
210 case PipeSink:-
211 ((!(process)) ? qt_assert("process",__FILE__,443445) : qt_noop());-
212 process->stdoutChannel.type = Normal;-
213 process->stdoutChannel.process = 0;-
214 break;-
215 }-
216-
217 type = Normal;-
218 file.clear();-
219 process = 0;-
220}-
221QProcessPrivate::QProcessPrivate()-
222{-
223 processChannelreadBufferChunkSize = QProcess::StandardOutput4096;-
224 writeBufferChunkSize = 4096;-
225 processChannelMode = QProcess::SeparateChannels;-
226 inputChannelMode = QProcess::ManagedInputChannel;-
227 processError = QProcess::UnknownError;-
228 processState = QProcess::NotRunning;-
229 pid = 0;-
230 sequenceNumber = 0;-
231 exitCode = 0;-
232 exitStatus = QProcess::NormalExit;-
233 startupSocketNotifier = 0;-
234 deathNotifier = 0;-
235 childStartedPipe[0] = -1;-
236 childStartedPipe[1] = -1;-
237 forkfd = -1;-
exitCode = 0;
238 crashed = false;-
239 dying = false;-
240 emittedReadyRead = false;-
241 emittedBytesWritten = false;-
242-
243-
244-
245-
246}
executed 2280 times by 35 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
  • ...
2280
247-
248-
249-
250-
251QProcessPrivate::~QProcessPrivate()-
252{-
253 if (stdinChannel.process)-
254 stdinChannel.process->stdoutChannel.clear();-
255 if (stdoutChannel.process)-
256 stdoutChannel.process->stdinChannel.clear();-
257}-
258-
259-
260-
261-
262void QProcessPrivate::cleanup()-
263{-
264 q_func()->setProcessState(QProcess::NotRunning);-
265 pid = 0;-
266 sequenceNumber = 0;-
267 dying = false;-
268-
269 if (stdoutChannel.notifier) {-
270 delete stdoutChannel.notifier;-
271 stdoutChannel.notifier = 0;-
272 }-
273 if (stderrChannel.notifier) {-
274 delete stderrChannel.notifier;-
275 stderrChannel.notifier = 0;-
276 }-
277 if (stdinChannel.notifier) {-
278 delete stdinChannel.notifier;-
279 stdinChannel.notifier = 0;-
280 }-
281 if (startupSocketNotifier) {-
282 delete startupSocketNotifier;-
283 startupSocketNotifier = 0;-
284 }-
285 if (deathNotifier) {-
286 delete deathNotifier;-
287 deathNotifier = 0;-
288 }-
289 closeChannel(&stdoutChannel);-
290 closeChannel(&stderrChannel);-
291 closeChannel(&stdinChannel);-
292 destroyPipe(childStartedPipe);-
293-
294 if (forkfd != -1)-
295 qt_safe_close(forkfd);-
296 forkfd = -1;-
297-
298}-
299-
300-
301-
302-
303void QProcessPrivate::setError(QProcess::ProcessError error, const QString &description)-
304{-
305 processError = error;-
306 if (description.isEmpty()) {-
307 switch (error) {-
308 case QProcess::FailedToStart:-
309 errorString = QProcess::tr("Process failed to start");-
310 break;-
311 case QProcess::Crashed:-
312 errorString = QProcess::tr("Process crashed");-
313 break;-
314 case QProcess::Timedout:-
315 errorString = QProcess::tr("Process operation timed out");-
316 break;-
317 case QProcess::ReadError:-
318 errorString = QProcess::tr("Error reading from process");-
319 break;-
320 case QProcess::WriteError:-
321 errorString = QProcess::tr("Error writing to process");-
322 break;-
323 case QProcess::UnknownError:-
324 errorString.clear();-
325 break;-
326 }-
327 } else {-
328 errorString = description;-
329 }-
330}-
331-
332-
333-
334-
335void QProcessPrivate::setErrorAndEmit(QProcess::ProcessError error, const QString &description)-
336{-
337 QProcess * const q = q_func();-
338 ((!(error != QProcess::UnknownError)) ? qt_assert("error != QProcess::UnknownError",__FILE__,956996) : qt_noop());-
339 setError(error, description);-
340 q->errorOccurred(processError);-
341 q->error(processError);-
342}-
343-
344-
345-
346-
347-
348bool QProcessPrivate::tryReadFromChannel(Channel *channel)-
349{-
350 QProcess * const q = q_func();-
351 if (channel->pipe[0] == -1
channel->pipe[0] == -1Description
TRUEevaluated 4635 times by 30 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
FALSEevaluated 37468 times by 30 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
)
4635-37468
352 return
executed 4635 times by 30 tests: return false;
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
false;
executed 4635 times by 30 tests: return false;
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
4635
353-
354 qint64 available = bytesAvailableInChannel(channel);-
355 if (available == 0
available == 0Description
TRUEevaluated 4607 times by 30 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
FALSEevaluated 32861 times by 26 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • ...
)
4607-32861
356 available = 1;
executed 4607 times by 30 tests: available = 1;
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
4607
357-
358 QProcess::ProcessChannel channelIdx = (channel == &stdoutChannel
channel == &stdoutChannelDescription
TRUEevaluated 34371 times by 30 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
FALSEevaluated 3097 times by 29 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • ...
3097-34371
359 ? QProcess::StandardOutput-
360 : QProcess::StandardError);-
361 ((!(readBuffers.size() > int(channelIdx))) ? qt_assert("readBuffers.size() > int(channelIdx)",__FILE__,1019) : qt_noop());-
362 QRingBuffer &readBuffer = readBuffers[int(channelIdx)];-
363 char *ptr = channel->bufferreadBuffer.reserve(available);-
364 qint64 readBytes = readFromChannel(channel, ptr, available);-
365 if (readBytes <= 0
readBytes <= 0Description
TRUEevaluated 4607 times by 30 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
FALSEevaluated 32861 times by 26 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • ...
)
4607-32861
366 channel->bufferreadBuffer
executed 4607 times by 30 tests: readBuffer.chop(available);
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
.chop(available);
executed 4607 times by 30 tests: readBuffer.chop(available);
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
4607
367 if (readBytes == -2
readBytes == -2Description
TRUEnever evaluated
FALSEevaluated 37468 times by 30 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
) {
0-37468
368-
369 return
never executed: return false;
false;
never executed: return false;
0
370 }-
371 if (readBytes == -1
readBytes == -1Description
TRUEnever evaluated
FALSEevaluated 37468 times by 30 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
) {
0-37468
372 setErrorAndEmit(QProcess::ReadError);-
373-
374-
375-
376 return
never executed: return false;
false;
never executed: return false;
0
377 }-
378 if (readBytes == 0
readBytes == 0Description
TRUEevaluated 4607 times by 30 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
FALSEevaluated 32861 times by 26 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • ...
) {
4607-32861
379-
380 if (channel->notifier
channel->notifierDescription
TRUEevaluated 4445 times by 28 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • ...
FALSEevaluated 162 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_qdbuscpp2xml
)
162-4445
381 channel->notifier->setEnabled(false);
executed 4445 times by 28 tests: channel->notifier->setEnabled(false);
Executed by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • ...
4445
382 closeChannel(channel);-
383-
384-
385-
386 return
executed 4607 times by 30 tests: return false;
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
false;
executed 4607 times by 30 tests: return false;
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
4607
387 }-
388-
389-
390-
391-
392-
393 if (channel->closed
channel->closedDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 32821 times by 26 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • ...
) {
40-32821
394 channel->bufferreadBuffer.chop(readBytes);-
395 return
executed 40 times by 1 test: return false;
Executed by:
  • tst_QProcess
false;
executed 40 times by 1 test: return false;
Executed by:
  • tst_QProcess
40
396 }-
397-
398 channel->bufferreadBuffer.chop(available - readBytes);-
399-
400 bool didRead = false;-
bool isStdout = channel == &stdoutChannel;
401 if (readBytes == 0
readBytes == 0Description
TRUEnever evaluated
FALSEevaluated 32821 times by 26 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • ...
) {
0-32821
402 if (channel->notifier
channel->notifierDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
403 channel->notifier->setEnabled(false);
never executed: channel->notifier->setEnabled(false);
0
404 }
never executed: end of block
else if ((processChannel == QProcess::StandardOutput)(currentReadChannel
currentReadCha... == channelIdxDescription
TRUEevaluated 31666 times by 22 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QFont
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
FALSEevaluated 1155 times by 11 tests
Evaluated by:
  • tst_Lancelot
  • tst_QIcon
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qmake
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_uic
== isStdoutchannelIdx
currentReadCha... == channelIdxDescription
TRUEevaluated 31666 times by 22 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QFont
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
FALSEevaluated 1155 times by 11 tests
Evaluated by:
  • tst_Lancelot
  • tst_QIcon
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qmake
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_uic
) {
0-31666
405 didRead = true;-
406 if (!emittedReadyRead
!emittedReadyReadDescription
TRUEevaluated 31665 times by 22 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QFont
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QProcess
) {
1-31665
407 emittedReadyRead = true;-
408 q->readyRead();-
409 emittedReadyRead = false;-
410 }
executed 31665 times by 22 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QFont
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
31665
411 }
executed 31666 times by 22 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QFont
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
31666
412 q->channelReadyRead(int(channelIdx));-
413 if (isStdoutchannelIdx == QProcess::StandardOutput
channelIdx == ...StandardOutputDescription
TRUEevaluated 32042 times by 22 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QFont
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
FALSEevaluated 779 times by 11 tests
Evaluated by:
  • tst_Lancelot
  • tst_QIcon
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qmake
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_uic
)
779-32042
414 q->readyReadStandardOutput(QProcess::QPrivateSignal());
executed 32042 times by 22 tests: q->readyReadStandardOutput(QProcess::QPrivateSignal());
Executed by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QFont
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
32042
415 else-
416 q->readyReadStandardError(QProcess::QPrivateSignal());
executed 779 times by 11 tests: q->readyReadStandardError(QProcess::QPrivateSignal());
Executed by:
  • tst_Lancelot
  • tst_QIcon
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qmake
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_uic
779
417 return
executed 32821 times by 26 tests: return didRead;
Executed by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • ...
didRead;
executed 32821 times by 26 tests: return didRead;
Executed by:
  • tst_Lancelot
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QFont
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • ...
32821
418}-
419-
420-
421-
422-
423bool QProcessPrivate::_q_canReadStandardOutput()-
424{-
425 return tryReadFromChannel(&stdoutChannel);-
426}-
427-
428-
429-
430-
431bool QProcessPrivate::_q_canReadStandardError()-
432{-
433 return tryReadFromChannel(&stderrChannel);-
434}-
435-
436-
437-
438-
439bool QProcessPrivate::_q_canWrite()-
440{-
441 if (stdinChannel.notifier
stdinChannel.notifierDescription
TRUEevaluated 3630 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
FALSEnever evaluated
)
0-3630
442 stdinChannel.notifier->setEnabled(false);
executed 3630 times by 6 tests: stdinChannel.notifier->setEnabled(false);
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
3630
443-
444 if (stdinChannel.bufferwriteBuffer
writeBuffer.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 3630 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
.isEmpty()
writeBuffer.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 3630 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
) {
0-3630
445-
446-
447-
448 return
never executed: return false;
false;
never executed: return false;
0
449 }-
450-
451 const bool writeSucceeded = writeToStdin();-
452-
453 if (stdinChannel.notifier
stdinChannel.notifierDescription
TRUEevaluated 3630 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
FALSEnever evaluated
&& !stdinChannel.bufferwriteBuffer.isEmpty()
!writeBuffer.isEmpty()Description
TRUEevaluated 2715 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
FALSEevaluated 915 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
)
0-3630
454 stdinChannel.notifier->setEnabled(true);
executed 2715 times by 2 tests: stdinChannel.notifier->setEnabled(true);
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
2715
455 if (stdinChannel.bufferwriteBuffer
writeBuffer.isEmpty()Description
TRUEevaluated 915 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
FALSEevaluated 2715 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
.isEmpty()
writeBuffer.isEmpty()Description
TRUEevaluated 915 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
FALSEevaluated 2715 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
&& stdinChannel.closed
stdinChannel.closedDescription
TRUEevaluated 459 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_qprocess - unknown status
FALSEevaluated 456 times by 4 tests
Evaluated by:
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
)
456-2715
456 closeWriteChannel();
executed 459 times by 3 tests: closeWriteChannel();
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_qprocess - unknown status
459
457 return
executed 3630 times by 6 tests: return writeSucceeded;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
writeSucceeded;
executed 3630 times by 6 tests: return writeSucceeded;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
3630
458}-
459-
460-
461-
462-
463bool QProcessPrivate::_q_processDied()-
464{-
465 QProcess * const q = q_func();-
466-
467-
468-
469-
470 if (!waitForDeadChild())-
471 return false;-
472 if (processState == QProcess::Starting) {-
473 if (!_q_startupNotification())-
474 return true;-
475 }-
476-
477 if (dying) {-
478-
479-
480-
481-
482 return true;-
483 }-
484 dying = true;-
485-
486-
487-
488-
489 _q_canReadStandardOutput();-
490 _q_canReadStandardError();-
491-
492 findExitCode();-
493-
494 if (crashed) {-
495 exitStatus = QProcess::CrashExit;-
496 setErrorAndEmit(QProcess::Crashed);-
497 }-
498-
499 bool wasRunning = (processState == QProcess::Running);-
500-
501 cleanup();-
502-
503 if (wasRunning) {-
504-
505 q->readChannelFinished();-
506-
507-
508-
509-
510 q->finished(exitCode);-
511 q->finished(exitCode, exitStatus);-
512 }-
513-
514-
515-
516 return true;-
517}-
518-
519-
520-
521-
522bool QProcessPrivate::_q_startupNotification()-
523{-
524 QProcess * const q = q_func();-
525-
526-
527-
528-
529 if (startupSocketNotifier)-
530 startupSocketNotifier->setEnabled(false);-
531 QString errorMessage;-
532 if (processStarted(&errorMessage)) {-
533 q->setProcessState(QProcess::Running);-
534 q->started(QProcess::QPrivateSignal());-
535 return true;-
536 }-
537-
538 q->setProcessState(QProcess::NotRunning);-
539 setErrorAndEmit(QProcess::FailedToStart, errorMessage);-
540-
541-
542 waitForDeadChild();-
543 findExitCode();-
544-
545 cleanup();-
546 return false;-
547}-
548-
549-
550-
551-
552void QProcessPrivate::closeWriteChannel()-
553{-
554-
555-
556-
557 if (stdinChannel.notifier) {-
558 delete stdinChannel.notifier;-
559 stdinChannel.notifier = 0;-
560 }-
561-
562-
563-
564-
565-
566 closeChannel(&stdinChannel);-
567}-
568-
569-
570-
571-
572QProcess::QProcess(QObject *parent)-
573 : QIODevice(*new QProcessPrivate, parent)-
574{-
575-
576-
577-
578}-
579-
580-
581-
582-
583-
584-
585-
586QProcess::~QProcess()-
587{-
588 QProcessPrivate * const d = d_func();-
589 if (d->processState != NotRunning) {-
590 QMessageLogger(__FILE__, 12131258, __PRETTY_FUNCTION__).warning().nospace()-
591 << "QProcess: Destroyed while process (" << QDir::toNativeSeparators(program()) << ") is still running.";-
592 kill();-
593 waitForFinished();-
594 }-
595-
596-
597 d->findExitCode();-
598-
599 d->cleanup();-
600}-
601QProcess::ProcessChannelMode QProcess::readChannelMode() const-
602{-
603 return processChannelMode();-
604}-
605void QProcess::setReadChannelMode(ProcessChannelMode mode)-
606{-
607 setProcessChannelMode(mode);-
608}-
609QProcess::ProcessChannelMode QProcess::processChannelMode() const-
610{-
611 const QProcessPrivate * const d = d_func();-
612 return d->processChannelMode;-
613}-
614void QProcess::setProcessChannelMode(ProcessChannelMode mode)-
615{-
616 QProcessPrivate * const d = d_func();-
617 d->processChannelMode = mode;-
618}-
619QProcess::InputChannelMode QProcess::inputChannelMode() const-
620{-
621 const QProcessPrivate * const d = d_func();-
622 return d->inputChannelMode;-
623}-
624void QProcess::setInputChannelMode(InputChannelMode mode)-
625{-
626 QProcessPrivate * const d = d_func();-
627 d->inputChannelMode = mode;-
628}-
629-
630-
631-
632-
633-
634-
635QProcess::ProcessChannel QProcess::readChannel() const-
636{-
637 const QProcessPrivate * const d = d_func();-
638 return
executed 2523 times by 16 tests: return ProcessChannel(d->currentReadChannel);
Executed by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
ProcessChannel(d->processChannel;currentReadChannel);
executed 2523 times by 16 tests: return ProcessChannel(d->currentReadChannel);
Executed by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
2523
639}-
640void QProcess::setReadChannel(ProcessChannel channel)-
{
QProcessPrivate * const d = d_func();
if (d->processChannel !=channel)
641{-
642 QByteArray buf = d->buffer.readAll();-
if (d->processChannel == QProcessQIODevice::StandardOutput) {
for (int i = buf.size() - 1; i >= 0; --i)
d->stdoutChannel.buffer.ungetChar(buf.at(i));
} else {
forsetCurrentReadChannel(inti = buf.size() - 1; i >= 0; --i)
d->stderrChannel.buffer.ungetChar(buf.at(i));
}
}
d->processChannel =channel;));
643}
executed 5181 times by 18 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QTcpSocket
  • tst_QTextStream
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
5181
644void QProcess::closeReadChannel(ProcessChannel channel)-
645{-
646 QProcessPrivate * const d = d_func();-
647-
648 if (channel == StandardOutput)-
649 d->stdoutChannel.closed = true;-
650 else-
651 d->stderrChannel.closed = true;-
652}-
653void QProcess::closeWriteChannel()-
654{-
655 QProcessPrivate * const d = d_func();-
656 d->stdinChannel.closed = true;-
657 if (d->stdinChannel.bufferwriteBuffer.isEmpty()
d->writeBuffer.isEmpty()Description
TRUEevaluated 170 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
  • tst_uic
FALSEevaluated 462 times by 5 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QTextCodec
  • tst_QTextStream
  • tst_qprocess - unknown status
)
170-462
658 d->closeWriteChannel();
executed 170 times by 6 tests: d->closeWriteChannel();
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
  • tst_uic
170
659}
executed 632 times by 8 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QTextCodec
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
  • tst_uic
632
660void QProcess::setStandardInputFile(const QString &fileName)-
661{-
662 QProcessPrivate * const d = d_func();-
663 d->stdinChannel = fileName;-
664}-
665void QProcess::setStandardOutputFile(const QString &fileName, OpenMode mode)-
666{-
667 ((!(mode == Append || mode == Truncate)) ? qt_assert("mode == Append || mode == Truncate",__FILE__,14441478) : qt_noop());-
668 QProcessPrivate * const d = d_func();-
669-
670 d->stdoutChannel = fileName;-
671 d->stdoutChannel.append = mode == Append;-
672}-
673void QProcess::setStandardErrorFile(const QString &fileName, OpenMode mode)-
674{-
675 ((!(mode == Append || mode == Truncate)) ? qt_assert("mode == Append || mode == Truncate",__FILE__,14711505) : qt_noop());-
676 QProcessPrivate * const d = d_func();-
677-
678 d->stderrChannel = fileName;-
679 d->stderrChannel.append = mode == Append;-
680}-
681void QProcess::setStandardOutputProcess(QProcess *destination)-
682{-
683 QProcessPrivate *dfrom = d_func();-
684 QProcessPrivate *dto = destination->d_func();-
685 dfrom->stdoutChannel.pipeTo(dto);-
686 dto->stdinChannel.pipeFrom(dfrom);-
687}-
688QString QProcess::workingDirectory() const-
689{-
690 const QProcessPrivate * const d = d_func();-
691 return d->workingDirectory;-
692}-
693void QProcess::setWorkingDirectory(const QString &dir)-
694{-
695 QProcessPrivate * const d = d_func();-
696 d->workingDirectory = dir;-
697}-
698Q_PID QProcess::pid() const-
699{-
700 const QProcessPrivate * const d = d_func();-
701 return d->pid;-
702}-
703-
704-
705-
706-
707-
708-
709-
710qint64 QProcess::processId() const-
711{-
712 const QProcessPrivate * const d = d_func();-
713-
714-
715-
716 return d->pid;-
717-
718}-
719-
720-
721-
722-
723-
724-
725-
726bool QProcess::canReadLine() const-
727{-
728 const QProcessPrivate * const d = d_func();1
const QRingBuffer *readBuffer = (d->processChannel == QProcess::StandardError)
? &d->stderrChannel.buffer
: &d->stdoutChannel.buffer;return
executed 1 time by 1 test: return QIODevice::canReadLine();
Executed by:
  • tst_QProcess
readBuffer->canReadLine() ||QIODevice::canReadLine();
executed 1 time by 1 test: return QIODevice::canReadLine();
Executed by:
  • tst_QProcess
729}-
730-
731-
732-
733-
734-
735-
736void QProcess::close()-
737{-
738 QProcessPrivate * const d = d_func();-
739 aboutToClose();-
740 while (waitForBytesWritten(-1)
waitForBytesWritten(-1)Description
TRUEnever evaluated
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
)
0-5
741 ;
never executed: ;
0
742 kill();-
743 waitForFinished(-1);-
744 d->setWriteChannelCount(0);-
745 QIODevice::close();-
746}
executed 5 times by 5 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
5
747-
748-
749-
750-
751-
752-
753bool QProcess::atEnd() const-
754{-
755 const QProcessPrivate * const d = d_func();61
const QRingBuffer *readBuffer = (d->processChannel == QProcess::StandardError)
? &d->stderrChannel.buffer
: &d->stdoutChannel.buffer;return
executed 61 times by 3 tests: return QIODevice::atEnd();
Executed by:
  • tst_Lancelot
  • tst_QNetworkReply
  • tst_QProcess
QIODevice::atEnd() && (!isOpen() || readBuffer->isEmpty());();
executed 61 times by 3 tests: return QIODevice::atEnd();
Executed by:
  • tst_Lancelot
  • tst_QNetworkReply
  • tst_QProcess
756}-
757-
758-
759-
760bool QProcess::isSequential() const-
761{-
762 return true;-
763}-
764-
765-
766-
767qint64 QProcess::bytesAvailable() const-
768{-
769 const QProcessPrivate * const d = d_func();872
const QRingBuffer *readBuffer = (d->processChannel == QProcess::StandardError)
? &d->stderrChannel.buffer
: &d->stdoutChannel.buffer;return
executed 872 times by 3 tests: return QIODevice::bytesAvailable();
Executed by:
  • tst_Lancelot
  • tst_QNetworkReply
  • tst_QProcess
readBuffer->size() +QIODevice::bytesAvailable();
executed 872 times by 3 tests: return QIODevice::bytesAvailable();
Executed by:
  • tst_Lancelot
  • tst_QNetworkReply
  • tst_QProcess
770}-
771-
772-
773-
774qint64 QProcess::bytesToWrite() const-
775{-
776 const QProcessPrivate * const d = d_func();qint64 size = d->stdinChannel.buffer.sizeQIODevice::bytesToWrite();-
777-
778-
779-
780 return
executed 3728 times by 2 tests: return size;
Executed by:
  • tst_QProcess
  • tst_qdbusxml2cpp
size;
executed 3728 times by 2 tests: return size;
Executed by:
  • tst_QProcess
  • tst_qdbusxml2cpp
3728
781}-
782-
783-
784-
785-
786-
787-
788QProcess::ProcessError QProcess::error() const-
789{-
790 const QProcessPrivate * const d = d_func();-
791 return d->processError;-
792}-
793-
794-
795-
796-
797-
798-
799QProcess::ProcessState QProcess::state() const-
800{-
801 const QProcessPrivate * const d = d_func();-
802 return d->processState;-
803}-
804void QProcess::setEnvironment(const QStringList &environment)-
805{-
806 setProcessEnvironment(QProcessEnvironmentPrivate::fromList(environment));-
807}-
808QStringList QProcess::environment() const-
809{-
810 const QProcessPrivate * const d = d_func();-
811 return d->environment.toStringList();-
812}-
813void QProcess::setProcessEnvironment(const QProcessEnvironment &environment)-
814{-
815 QProcessPrivate * const d = d_func();-
816 d->environment = environment;-
817}-
818QProcessEnvironment QProcess::processEnvironment() const-
819{-
820 const QProcessPrivate * const d = d_func();-
821 return d->environment;-
822}-
823bool QProcess::waitForStarted(int msecs)-
824{-
825 QProcessPrivate * const d = d_func();-
826 if (d->processState == QProcess::Starting)-
827 return d->waitForStarted(msecs);-
828-
829 return d->processState == QProcess::Running;-
830}-
831-
832-
833-
834bool QProcess::waitForReadyRead(int msecs)-
835{-
836 QProcessPrivate * const d = d_func();-
837-
838 if (d->processState == QProcess::NotRunning
d->processStat...ss::NotRunningDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 709 times by 9 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
)
1-709
839 return
executed 1 time by 1 test: return false;
Executed by:
  • tst_QProcess
false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QProcess
1
840 if (d->processChannelcurrentReadChannel == QProcess::StandardOutput
d->currentRead...StandardOutputDescription
TRUEevaluated 681 times by 8 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_QTextStream
&& d->stdoutChannel.closed
d->stdoutChannel.closedDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 676 times by 8 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
)
5-681
841 return
executed 5 times by 1 test: return false;
Executed by:
  • tst_QProcess
false;
executed 5 times by 1 test: return false;
Executed by:
  • tst_QProcess
5
842 if (d->processChannelcurrentReadChannel == QProcess::StandardError
d->currentRead...:StandardErrorDescription
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_QTextStream
FALSEevaluated 676 times by 8 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
&& d->stderrChannel.closed
d->stderrChannel.closedDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 23 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_QTextStream
)
5-676
843 return
executed 5 times by 1 test: return false;
Executed by:
  • tst_QProcess
false;
executed 5 times by 1 test: return false;
Executed by:
  • tst_QProcess
5
844 return
executed 699 times by 9 tests: return d->waitForReadyRead(msecs);
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
d->waitForReadyRead(msecs);
executed 699 times by 9 tests: return d->waitForReadyRead(msecs);
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
699
845}-
846-
847-
848-
849bool QProcess::waitForBytesWritten(int msecs)-
850{-
851 QProcessPrivate * const d = d_func();-
852 if (d->processState == QProcess::NotRunning)-
853 return false;-
854 if (d->processState == QProcess::Starting) {-
855 QElapsedTimer stopWatch;-
856 stopWatch.start();-
857 bool started = waitForStarted(msecs);-
858 if (!started)-
859 return false;-
860 msecs = qt_subtract_from_timeout(msecs, stopWatch.elapsed());-
861 }-
862-
863 return d->waitForBytesWritten(msecs);-
864}-
865bool QProcess::waitForFinished(int msecs)-
866{-
867 QProcessPrivate * const d = d_func();-
868 if (d->processState == QProcess::NotRunning)-
869 return false;-
870 if (d->processState == QProcess::Starting) {-
871 QElapsedTimer stopWatch;-
872 stopWatch.start();-
873 bool started = waitForStarted(msecs);-
874 if (!started)-
875 return false;-
876 msecs = qt_subtract_from_timeout(msecs, stopWatch.elapsed());-
877 }-
878-
879 return d->waitForFinished(msecs);-
880}-
881-
882-
883-
884-
885-
886-
887void QProcess::setProcessState(ProcessState state)-
888{-
889 QProcessPrivate * const d = d_func();-
890 if (d->processState == state)-
891 return;-
892 d->processState = state;-
893 stateChanged(state, QPrivateSignal());-
894}-
895void QProcess::setupChildProcess()-
896{-
897}-
898-
899-
900-
901qint64 QProcess::readData(char *data, qint64 maxlen)-
902{-
903 QProcessPrivate * const d = d_func();-
904 if (!maxlen)-
return 0;
QRingBuffer *readBuffer =(d->processChannel == QProcess::StandardErrorvoid)? &d->stderrChannel.buffer
: &d->stdoutChannel.buffer;data;;
905 if ((!
!maxlenDescription
TRUEevaluated 258 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
FALSEevaluated 4081 times by 18 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
maxlen== 1 && !readBuffer->isEmpty()) {
!maxlenDescription
TRUEevaluated 258 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
FALSEevaluated 4081 times by 18 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
258-4081
int c = readBuffer->getChar();
!maxlenDescription
TRUEevaluated 258 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
FALSEevaluated 4081 times by 18 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
if (c == -1) {
!maxlenDescription
TRUEevaluated 258 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
FALSEevaluated 4081 times by 18 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
return -1;
!maxlenDescription
TRUEevaluated 258 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
FALSEevaluated 4081 times by 18 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
}
!maxlenDescription
TRUEevaluated 258 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
FALSEevaluated 4081 times by 18 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
*data = (char
!maxlenDescription
TRUEevaluated 258 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
FALSEevaluated 4081 times by 18 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
)
906 c;return
executed 258 times by 6 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
1;
executed 258 times by 6 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
258
}
executed 258 times by 6 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
qint64 bytesToRead = qMin(readBuffer->size(), maxlen);
executed 258 times by 6 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
qint64 readSoFar =
executed 258 times by 6 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
executed 258 times by 6 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
0;
executed 258 times by 6 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
while (readSoFar < bytesToRead) {
executed 258 times by 6 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
const char *ptr = readBuffer->readPointer();
executed 258 times by 6 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
qint64 bytesToReadFromThisBlock = qMin(bytesToRead - readSoFar,
executed 258 times by 6 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
readBuffer->nextDataBlockSize());
executed 258 times by 6 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
memcpy(data + readSoFar, ptr, bytesToReadFromThisBlock);
executed 258 times by 6 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
readSoFar += bytesToReadFromThisBlock
executed 258 times by 6 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
executed 258 times by 6 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
;
executed 258 times by 6 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_rcc
907 readBuffer->free(bytesToReadFromThisBlock);598-3483
}if (!readSoFar &&(d->processState == QProcess::NotRunning
d->processStat...ss::NotRunningDescription
TRUEevaluated 3483 times by 16 tests
Evaluated by:
  • tst_Lancelot
  • tst_QFont
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
FALSEevaluated 598 times by 5 tests
Evaluated by:
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
)
908 return
executed 3483 times by 16 tests: return -1;
Executed by:
  • tst_Lancelot
  • tst_QFont
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
-1;
executed 3483 times by 16 tests: return -1;
Executed by:
  • tst_Lancelot
  • tst_QFont
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
3483
909 return
executed 598 times by 5 tests: return 0;
Executed by:
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
readSoFar0;
executed 598 times by 5 tests: return 0;
Executed by:
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
598
910}-
911-
912-
913-
914qint64 QProcess::writeData(const char *data, qint64 len)-
915{-
916 QProcessPrivate * const d = d_func();-
917 if (d->stdinChannel.closed
d->stdinChannel.closedDescription
TRUEnever evaluated
FALSEevaluated 1167 times by 7 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextCodec
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
) {
0-1167
918-
919-
920-
921-
922 return
never executed: return 0;
0;
never executed: return 0;
0
}
never executed: return 0;
if (len == 1) {
never executed: return 0;
d->stdinChannel.buffer.putChar(*data);
never executed: return 0;
if (d->stdinChannel.notifier)
never executed: return 0;
d->stdinChannel.notifier->setEnabled(true);
never executed: return 0;
return 1
never executed: return 0;
never executed: return 0;
;
never executed: return 0;
923 }-
924 char *dest =d->stdinChannel.bufferwriteBuffer.reserve(len);-
memcpyappend(dest,data, len);
925-
926-
927-
928-
929 if (d->stdinChannel.notifier
d->stdinChannel.notifierDescription
TRUEevaluated 1167 times by 7 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextCodec
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
FALSEnever evaluated
)
0-1167
930 d->stdinChannel.notifier->setEnabled(true);
executed 1167 times by 7 tests: d->stdinChannel.notifier->setEnabled(true);
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextCodec
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
1167
931-
932-
933-
934-
935-
936 return
executed 1167 times by 7 tests: return len;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextCodec
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
len;
executed 1167 times by 7 tests: return len;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextCodec
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
1167
937}-
938QByteArray QProcess::readAllStandardOutput()-
939{-
940 ProcessChannel tmp = readChannel();-
941 setReadChannel(StandardOutput);-
942 QByteArray data = readAll();-
943 setReadChannel(tmp);-
944 return data;-
945}-
946QByteArray QProcess::readAllStandardError()-
947{-
948 ProcessChannel tmp = readChannel();-
949 setReadChannel(StandardError);-
950 QByteArray data = readAll();-
951 setReadChannel(tmp);-
952 return data;-
953}-
954void QProcess::start(const QString &program, const QStringList &arguments, OpenMode mode)-
955{-
956 QProcessPrivate * const d = d_func();-
957 if (d->processState != NotRunning) {-
958 QMessageLogger(__FILE__, 20892083, __PRETTY_FUNCTION__).warning("QProcess::start: Process is already running");-
959 return;-
960 }-
961 if (program.isEmpty()) {-
962 d->setErrorAndEmit(QProcess::FailedToStart, tr("No program defined"));-
963 return;-
964 }-
965-
966 d->program = program;-
967 d->arguments = arguments;-
968-
969 d->start(mode);-
970}-
971void QProcess::start(OpenMode mode)-
972{-
973 QProcessPrivate * const d = d_func();-
974 if (d->processState != NotRunning) {-
975 QMessageLogger(__FILE__, 21162110, __PRETTY_FUNCTION__).warning("QProcess::start: Process is already running");-
976 return;-
977 }-
978 if (d->program.isEmpty()) {-
979 d->setErrorAndEmit(QProcess::FailedToStart, tr("No program defined"));-
980 return;-
981 }-
982-
983 d->start(mode);-
984}-
985bool QProcess::open(OpenMode mode)-
986{-
987 QProcessPrivate * const d = d_func();-
988 if (d->processState != NotRunning) {-
989 QMessageLogger(__FILE__, 21402134, __PRETTY_FUNCTION__).warning("QProcess::start: Process is already running");-
990 return false;-
991 }-
992 if (d->program.isEmpty()) {-
993 QMessageLogger(__FILE__, 21442138, __PRETTY_FUNCTION__).warning("QProcess::start: program not set");-
994 return false;-
995 }-
996-
997 d->start(mode);-
998 return true;-
999}-
1000-
1001void QProcessPrivate::start(QIODevice::OpenMode mode)-
1002{-
1003 QProcess * const q = q_func();-
stdinChannel.buffer.clear();
stdoutChannel.buffer.clear();
stderrChannel.buffer.clear();
1004-
1005-
1006-
1007-
1008 if (stdinChannel.type != QProcessPrivate::Channel::Normal
stdinChannel.t...hannel::NormalDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 3018 times by 39 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QTextCodec
  • ...
)
5-3018
1009 mode &= ~QIODevice::WriteOnly;
executed 5 times by 1 test: mode &= ~QIODevice::WriteOnly;
Executed by:
  • tst_QProcess
5
1010 if (stdoutChannel.type != QProcessPrivate::Channel::Normal
stdoutChannel....hannel::NormalDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 3014 times by 39 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QTextCodec
  • ...
&&
9-3014
1011 (stderrChannel.type != QProcessPrivate::Channel::Normal
stderrChannel....hannel::NormalDescription
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_QProcess
||
0-9
1012 processChannelMode == QProcess::MergedChannels
processChannel...MergedChannelsDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QProcess
))
3-6
1013 mode &= ~QIODevice::ReadOnly;
executed 3 times by 1 test: mode &= ~QIODevice::ReadOnly;
Executed by:
  • tst_QProcess
3
1014 if (mode == 0
mode == 0Description
TRUEnever evaluated
FALSEevaluated 3023 times by 39 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QTextCodec
  • ...
)
0-3023
1015 mode = QIODevice::Unbuffered;
never executed: mode = QIODevice::Unbuffered;
0
1016-
1017 if ((
(mode & QIODev...ReadOnly) == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 3019 times by 39 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QTextCodec
  • ...
mode & QIODevice::ReadOnly) == 0
(mode & QIODev...ReadOnly) == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 3019 times by 39 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QTextCodec
  • ...
) {
4-3019
1018 if (stdoutChannel.type == QProcessPrivate::Channel::Normal
stdoutChannel....hannel::NormalDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QProcess
)
1-3
1019 q->setStandardOutputFile(q->nullDevice());
executed 1 time by 1 test: q->setStandardOutputFile(q->nullDevice());
Executed by:
  • tst_QProcess
1
1020 if (stderrChannel.type == QProcessPrivate::Channel::Normal
stderrChannel....hannel::NormalDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEnever evaluated
0-4
1021 && processChannelMode != QProcess::MergedChannels
processChannel...MergedChannelsDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QProcess
)
1-3
1022 q->setStandardErrorFile(q->nullDevice());
executed 1 time by 1 test: q->setStandardErrorFile(q->nullDevice());
Executed by:
  • tst_QProcess
1
1023 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QProcess
4
1024-
1025-
1026 q->QIODevice::open(mode);-
1027-
1028 if (q->isReadable()
q->isReadable()Description
TRUEevaluated 3019 times by 39 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QTextCodec
  • ...
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QProcess
&& processChannelMode != QProcess::MergedChannels
processChannel...MergedChannelsDescription
TRUEevaluated 3004 times by 38 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QIcon
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextStream
  • ...
FALSEevaluated 15 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QProcess
)
4-3019
1029 setReadChannelCount(2
executed 3004 times by 38 tests: setReadChannelCount(2);
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QIcon
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextStream
  • ...
executed 3004 times by 38 tests: setReadChannelCount(2);
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QIcon
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextStream
  • ...
);
executed 3004 times by 38 tests: setReadChannelCount(2);
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QIcon
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextStream
  • ...
3004
1030-
1031 stdinChannel.closed = false;-
1032 stdoutChannel.closed = false;-
1033 stderrChannel.closed = false;-
1034-
1035 exitCode = 0;-
1036 exitStatus = QProcess::NormalExit;-
1037 processError = QProcess::UnknownError;-
1038 errorString.clear();-
1039 startProcess();-
1040}
executed 3023 times by 39 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QTextCodec
  • ...
3023
1041-
1042-
1043static QStringList parseCombinedArgString(const QString &program)-
1044{-
1045 QStringList args;-
1046 QString tmp;-
1047 int quoteCount = 0;-
1048 bool inQuote = false;-
1049-
1050-
1051-
1052-
1053 for (int i = 0; i < program.size(); ++i) {-
1054 if (program.at(i) == QLatin1Char('"')) {-
1055 ++quoteCount;-
1056 if (quoteCount == 3) {-
1057-
1058 quoteCount = 0;-
1059 tmp += program.at(i);-
1060 }-
1061 continue;-
1062 }-
1063 if (quoteCount) {-
1064 if (quoteCount == 1)-
1065 inQuote = !inQuote;-
1066 quoteCount = 0;-
1067 }-
1068 if (!inQuote && program.at(i).isSpace()) {-
1069 if (!tmp.isEmpty()) {-
1070 args += tmp;-
1071 tmp.clear();-
1072 }-
1073 } else {-
1074 tmp += program.at(i);-
1075 }-
1076 }-
1077 if (!tmp.isEmpty())-
1078 args += tmp;-
1079-
1080 return args;-
1081}-
1082void QProcess::start(const QString &command, OpenMode mode)-
1083{-
1084 QStringList args = parseCombinedArgString(command);-
1085 if (args.isEmpty()
args.isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 1318 times by 16 tests
Evaluated by:
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QTextCodec
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
  • tst_QUuid
  • tst_qmessagehandler
  • tst_qprocess - unknown status
) {
4-1318
1086 QProcessPrivate * const d = d_func();-
1087 d->setErrorAndEmit(QProcess::FailedToStart, tr("No program defined"));-
1088 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_QProcess
4
1089 }-
1090-
1091 const QString prog = args.first();-
args.removeFirsttakeFirst();
1092-
1093 start(prog, args, mode);-
1094}
executed 1318 times by 16 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QTextCodec
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
  • tst_QUuid
  • tst_qmessagehandler
  • tst_qprocess - unknown status
1318
1095QString QProcess::program() const-
1096{-
1097 const QProcessPrivate * const d = d_func();-
1098 return d->program;-
1099}-
1100void QProcess::setProgram(const QString &program)-
1101{-
1102 QProcessPrivate * const d = d_func();-
1103 if (d->processState != NotRunning) {-
1104 QMessageLogger(__FILE__, 23152307, __PRETTY_FUNCTION__).warning("QProcess::setProgram: Process is already running");-
1105 return;-
1106 }-
1107 d->program = program;-
1108}-
1109QStringList QProcess::arguments() const-
1110{-
1111 const QProcessPrivate * const d = d_func();-
1112 return d->arguments;-
1113}-
1114void QProcess::setArguments(const QStringList &arguments)-
1115{-
1116 QProcessPrivate * const d = d_func();-
1117 if (d->processState != NotRunning) {-
1118 QMessageLogger(__FILE__, 23462338, __PRETTY_FUNCTION__).warning("QProcess::setProgram: Process is already running");-
1119 return;-
1120 }-
1121 d->arguments = arguments;-
1122}-
1123void QProcess::terminate()-
1124{-
1125 QProcessPrivate * const d = d_func();-
1126 d->terminateProcess();-
1127}-
1128void QProcess::kill()-
1129{-
1130 QProcessPrivate * const d = d_func();-
1131 d->killProcess();-
1132}-
1133-
1134-
1135-
1136-
1137-
1138-
1139int QProcess::exitCode() const-
1140{-
1141 const QProcessPrivate * const d = d_func();-
1142 return d->exitCode;-
1143}-
1144QProcess::ExitStatus QProcess::exitStatus() const-
1145{-
1146 const QProcessPrivate * const d = d_func();-
1147 return d->exitStatus;-
1148}-
1149int QProcess::execute(const QString &program, const QStringList &arguments)-
1150{-
1151 QProcess process;-
1152 process.setReadChannelMode(ForwardedChannels);-
1153 process.start(program, arguments);-
1154 if (!process.waitForFinished(-1) || process.error() == FailedToStart)-
1155 return -2;-
1156 return process.exitStatus() == QProcess::NormalExit ? process.exitCode() : -1;-
1157}-
1158int QProcess::execute(const QString &command)-
1159{-
1160 QProcess process;-
1161 process.setReadChannelMode(ForwardedChannels);-
1162 process.start(command);-
1163 if (!process.waitForFinished(-1) || process.error() == FailedToStart)-
1164 return -2;-
1165 return process.exitStatus() == QProcess::NormalExit ? process.exitCode() : -1;-
1166}-
1167bool QProcess::startDetached(const QString &program,-
1168 const QStringList &arguments,-
1169 const QString &workingDirectory,-
1170 qint64 *pid)-
1171{-
1172 return QProcessPrivate::startDetached(program,-
1173 arguments,-
1174 workingDirectory,-
1175 pid);-
1176}-
1177-
1178-
1179-
1180-
1181bool QProcess::startDetached(const QString &program,-
1182 const QStringList &arguments)-
1183{-
1184 return QProcessPrivate::startDetached(program, arguments);-
1185}-
1186bool QProcess::startDetached(const QString &command)-
1187{-
1188 QStringList args = parseCombinedArgString(command);-
1189 if (args.isEmpty()
args.isEmpty()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QProcess
)
2-3
1190 return
executed 3 times by 1 test: return false;
Executed by:
  • tst_QProcess
false;
executed 3 times by 1 test: return false;
Executed by:
  • tst_QProcess
3
1191-
1192 const QString prog = args.first();-
args.removeFirsttakeFirst();
1193-
1194 return
executed 2 times by 1 test: return QProcessPrivate::startDetached(prog, args);
Executed by:
  • tst_QProcess
QProcessPrivate::startDetached(prog, args);
executed 2 times by 1 test: return QProcessPrivate::startDetached(prog, args);
Executed by:
  • tst_QProcess
2
1195}-
1196-
1197-
1198-
1199-
1200-
1201-
1202-
1203-
1204-
1205 extern char **environ;-
1206-
1207-
1208QStringList QProcess::systemEnvironment()-
1209{-
1210 QStringList tmp;-
1211 char *entry = 0;-
1212 int count = 0;-
1213 while ((entry = environ[count++]))-
1214 tmp << QString::fromLocal8Bit(entry);-
1215 return tmp;-
1216}-
1217QString QProcess::nullDevice()-
1218{-
1219-
1220-
1221-
1222 return ([]() -> QString { enum { Size = sizeof(u"" "/dev/null")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "/dev/null" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());-
1223-
1224}-
1225-
1226-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9