qprocess_unix.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qprocess_unix.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2015 The Qt Company Ltd.-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the QtCore module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 2.1 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32****************************************************************************/-
33-
34//#define QPROCESS_DEBUG-
35#include "qdebug.h"-
36-
37#ifndef QT_NO_PROCESS-
38-
39#if defined QPROCESS_DEBUG-
40#include "private/qtools_p.h"-
41#include <ctype.h>-
42-
43/*-
44 Returns a human readable representation of the first \a len-
45 characters in \a data.-
46*/-
47QT_BEGIN_NAMESPACE-
48static QByteArray qt_prettyDebug(const char *data, int len, int maxSize)-
49{-
50 if (!data) return "(null)";-
51 QByteArray out;-
52 for (int i = 0; i < len; ++i) {-
53 char c = data[i];-
54 if (isprint(c)) {-
55 out += c;-
56 } else switch (c) {-
57 case '\n': out += "\\n"; break;-
58 case '\r': out += "\\r"; break;-
59 case '\t': out += "\\t"; break;-
60 default: {-
61 const char buf[] = {-
62 '\\',-
63 QtMiscUtils::toOct(uchar(c) / 64),-
64 QtMiscUtils::toOct(uchar(c) % 64 / 8),-
65 QtMiscUtils::toOct(uchar(c) % 8),-
66 0-
67 };-
68 out += buf;-
69 }-
70 }-
71 }-
72-
73 if (len < maxSize)-
74 out += "...";-
75-
76 return out;-
77}-
78QT_END_NAMESPACE-
79#endif-
80-
81#include "qplatformdefs.h"-
82-
83#include "qprocess.h"-
84#include "qprocess_p.h"-
85#include "private/qcore_unix_p.h"-
86-
87#ifdef Q_OS_MAC-
88#include <private/qcore_mac_p.h>-
89#endif-
90-
91#include <private/qcoreapplication_p.h>-
92#include <private/qthread_p.h>-
93#include <qfile.h>-
94#include <qfileinfo.h>-
95#include <qdir.h>-
96#include <qlist.h>-
97#include <qmutex.h>-
98#include <qsemaphore.h>-
99#include <qsocketnotifier.h>-
100#include <qthread.h>-
101#include <qelapsedtimer.h>-
102-
103#ifdef Q_OS_QNX-
104# include <sys/neutrino.h>-
105#endif-
106-
107#include <errno.h>-
108#include <stdlib.h>-
109#include <string.h>-
110#include <forkfd.h>-
111-
112QT_BEGIN_NAMESPACE-
113-
114// POSIX requires PIPE_BUF to be 512 or larger-
115// so we will use 512-
116static const int errorBufferMax = 512;-
117-
118static inline void add_fd(int &nfds, int fd, fd_set *fdset)-
119{-
120 FD_SET(fd, fdset);-
121 if ((fd) > nfds)
(fd) > nfdsDescription
TRUEevaluated 110516 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
FALSEevaluated 2525 times by 11 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
2525-110516
122 nfds = fd;
executed 110516 times by 28 tests: nfds = fd;
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
110516
123}
executed 113041 times by 29 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QMimeDatabase
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTextStream
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • ...
113041
124-
125static int qt_create_pipe(int *pipe)-
126{-
127 if (pipe[0] != -1)
pipe[0] != -1Description
TRUEnever evaluated
FALSEevaluated 9861 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_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
  • ...
0-9861
128 qt_safe_close(pipe[0]);
never executed: qt_safe_close(pipe[0]);
0
129 if (pipe[1] != -1)
pipe[1] != -1Description
TRUEnever evaluated
FALSEevaluated 9861 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_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
  • ...
0-9861
130 qt_safe_close(pipe[1]);
never executed: qt_safe_close(pipe[1]);
0
131 int pipe_ret = qt_safe_pipe(pipe);-
132 if (pipe_ret != 0) {
pipe_ret != 0Description
TRUEnever evaluated
FALSEevaluated 9861 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_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
  • ...
0-9861
133 qWarning("QProcessPrivate::createPipe: Cannot create pipe %p: %s",-
134 pipe, qPrintable(qt_error_string(errno)));-
135 }
never executed: end of block
0
136 return pipe_ret;
executed 9861 times by 38 tests: return pipe_ret;
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_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
  • ...
9861
137}-
138-
139void QProcessPrivate::destroyPipe(int *pipe)-
140{-
141 if (pipe[1] != -1) {
pipe[1] != -1Description
TRUEevaluated 2468 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_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
  • ...
FALSEevaluated 18075 times by 43 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_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
  • ...
2468-18075
142 qt_safe_close(pipe[1]);-
143 pipe[1] = -1;-
144 }
executed 2468 times by 38 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_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
  • ...
2468
145 if (pipe[0] != -1) {
pipe[0] != -1Description
TRUEevaluated 4917 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_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
  • ...
FALSEevaluated 15626 times by 43 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_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
  • ...
4917-15626
146 qt_safe_close(pipe[0]);-
147 pipe[0] = -1;-
148 }
executed 4917 times by 38 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_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
  • ...
4917
149}
executed 20543 times by 43 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_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
  • ...
20543
150-
151void QProcessPrivate::closeChannel(Channel *channel)-
152{-
153 destroyPipe(channel->pipe);-
154}
executed 16335 times by 43 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_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
  • ...
16335
155-
156/*-
157 Create the pipes to a QProcessPrivate::Channel.-
158-
159 This function must be called in order: stdin, stdout, stderr-
160*/-
161bool QProcessPrivate::openChannel(Channel &channel)-
162{-
163 Q_Q(QProcess);-
164-
165 if (&channel == &stderrChannel && processChannelMode == QProcess::MergedChannels) {
&channel == &stderrChannelDescription
TRUEevaluated 2473 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_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
  • ...
FALSEevaluated 4946 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_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
  • ...
processChannel...MergedChannelsDescription
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QProcess
FALSEevaluated 2457 times by 37 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_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
  • tst_QUdpSocket
  • ...
16-4946
166 channel.pipe[0] = -1;-
167 channel.pipe[1] = -1;-
168 return true;
executed 16 times by 2 tests: return true;
Executed by:
  • tst_QMimeDatabase
  • tst_QProcess
16
169 }-
170-
171 if (channel.type == Channel::Normal) {
channel.type =...hannel::NormalDescription
TRUEevaluated 7385 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_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
  • ...
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_QProcess
18-7385
172 // we're piping this channel to our own process-
173 if (qt_create_pipe(channel.pipe) != 0)
qt_create_pipe...nel.pipe) != 0Description
TRUEnever evaluated
FALSEevaluated 7385 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_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
  • ...
0-7385
174 return false;
never executed: return false;
0
175-
176 // create the socket notifiers-
177 if (threadData->hasEventDispatcher()) {
threadData->ha...ntDispatcher()Description
TRUEevaluated 7142 times by 36 tests
Evaluated by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • ...
FALSEevaluated 243 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_qdbuscpp2xml
243-7142
178 if (&channel == &stdinChannel) {
&channel == &stdinChannelDescription
TRUEevaluated 2387 times by 36 tests
Evaluated by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • ...
FALSEevaluated 4755 times by 36 tests
Evaluated by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • ...
2387-4755
179 channel.notifier = new QSocketNotifier(channel.pipe[1],-
180 QSocketNotifier::Write, q);-
181 channel.notifier->setEnabled(false);-
182 QObject::connect(channel.notifier, SIGNAL(activated(int)),-
183 q, SLOT(_q_canWrite()));-
184 } else {
executed 2387 times by 36 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • ...
2387
185 channel.notifier = new QSocketNotifier(channel.pipe[0],-
186 QSocketNotifier::Read, q);-
187 const char *receiver;-
188 if (&channel == &stdoutChannel)
&channel == &stdoutChannelDescription
TRUEevaluated 2382 times by 36 tests
Evaluated by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • ...
FALSEevaluated 2373 times by 35 tests
Evaluated by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • tst_QUdpSocket
  • tst_QUndoGroup
  • ...
2373-2382
189 receiver = SLOT(_q_canReadStandardOutput());
executed 2382 times by 36 tests: receiver = qFlagLocation("1""_q_canReadStandardOutput()" "\0" __FILE__ ":" "189");
Executed by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • ...
2382
190 else-
191 receiver = SLOT(_q_canReadStandardError());
executed 2373 times by 35 tests: receiver = qFlagLocation("1""_q_canReadStandardError()" "\0" __FILE__ ":" "191");
Executed by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • tst_QUdpSocket
  • tst_QUndoGroup
  • ...
2373
192 QObject::connect(channel.notifier, SIGNAL(activated(int)),-
193 q, receiver);-
194 }
executed 4755 times by 36 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • ...
4755
195 }-
196-
197 return true;
executed 7385 times by 38 tests: return true;
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_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
  • ...
7385
198 } else if (channel.type == Channel::Redirect) {
channel.type =...nnel::RedirectDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QProcess
6-12
199 // we're redirecting the channel to/from a file-
200 QByteArray fname = QFile::encodeName(channel.file);-
201-
202 if (&channel == &stdinChannel) {
&channel == &stdinChannelDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_QProcess
2-10
203 // try to open in read-only mode-
204 channel.pipe[1] = -1;-
205 if ( (channel.pipe[0] = qt_safe_open(fname, O_RDONLY)) != -1)
(channel.pipe[...me, 00)) != -1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEnever evaluated
0-2
206 return true; // success
executed 2 times by 1 test: return true;
Executed by:
  • tst_QProcess
2
207 setErrorAndEmit(QProcess::FailedToStart,-
208 QProcess::tr("Could not open input redirection for reading"));-
209 } else {
never executed: end of block
0
210 int mode = O_WRONLY | O_CREAT;-
211 if (channel.append)
channel.appendDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_QProcess
3-7
212 mode |= O_APPEND;
executed 3 times by 1 test: mode |= 02000;
Executed by:
  • tst_QProcess
3
213 else-
214 mode |= O_TRUNC;
executed 7 times by 1 test: mode |= 01000;
Executed by:
  • tst_QProcess
7
215-
216 channel.pipe[0] = -1;-
217 if ( (channel.pipe[1] = qt_safe_open(fname, mode, 0666)) != -1)
(channel.pipe[..., 0666)) != -1Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEnever evaluated
0-10
218 return true; // success
executed 10 times by 1 test: return true;
Executed by:
  • tst_QProcess
10
219-
220 setErrorAndEmit(QProcess::FailedToStart,-
221 QProcess::tr("Could not open input redirection for reading"));-
222 }
never executed: end of block
0
223 cleanup();-
224 return false;
never executed: return false;
0
225 } else {-
226 Q_ASSERT_X(channel.process, "QProcess::start", "Internal error");-
227-
228 Channel *source;-
229 Channel *sink;-
230-
231 if (channel.type == Channel::PipeSource) {
channel.type =...el::PipeSourceDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QProcess
3
232 // we are the source-
233 source = &channel;-
234 sink = &channel.process->stdinChannel;-
235-
236 Q_ASSERT(source == &stdoutChannel);-
237 Q_ASSERT(sink->process == this && sink->type == Channel::PipeSink);-
238 } else {
executed 3 times by 1 test: end of block
Executed by:
  • tst_QProcess
3
239 // we are the sink;-
240 source = &channel.process->stdoutChannel;-
241 sink = &channel;-
242-
243 Q_ASSERT(sink == &stdinChannel);-
244 Q_ASSERT(source->process == this && source->type == Channel::PipeSource);-
245 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QProcess
3
246-
247 if (source->pipe[1] != INVALID_Q_PIPE || sink->pipe[0] != INVALID_Q_PIPE) {
source->pipe[1] != -1Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QProcess
sink->pipe[0] != -1Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QProcess
0-6
248 // already created, do nothing-
249 return true;
executed 3 times by 1 test: return true;
Executed by:
  • tst_QProcess
3
250 } else {-
251 Q_ASSERT(source->pipe[0] == INVALID_Q_PIPE && source->pipe[1] == INVALID_Q_PIPE);-
252 Q_ASSERT(sink->pipe[0] == INVALID_Q_PIPE && sink->pipe[1] == INVALID_Q_PIPE);-
253-
254 Q_PIPE pipe[2] = { -1, -1 };-
255 if (qt_create_pipe(pipe) != 0)
qt_create_pipe(pipe) != 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QProcess
0-3
256 return false;
never executed: return false;
0
257 sink->pipe[0] = pipe[0];-
258 source->pipe[1] = pipe[1];-
259-
260 return true;
executed 3 times by 1 test: return true;
Executed by:
  • tst_QProcess
3
261 }-
262 }-
263}-
264-
265QT_BEGIN_INCLUDE_NAMESPACE-
266#if defined(Q_OS_MACX)-
267# include <crt_externs.h>-
268# define environ (*_NSGetEnviron())-
269#else-
270 extern char **environ;-
271#endif-
272QT_END_INCLUDE_NAMESPACE-
273-
274QProcessEnvironment QProcessEnvironment::systemEnvironment()-
275{-
276 QProcessEnvironment env;-
277#if !defined(Q_OS_IOS)-
278 const char *entry;-
279 for (int count = 0; (entry = environ[count]); ++count) {
(entry = environ[count])Description
TRUEevaluated 301 times by 3 tests
Evaluated by:
  • tst_QProcess
  • tst_QProcessEnvironment
  • tst_Selftests
FALSEevaluated 10 times by 3 tests
Evaluated by:
  • tst_QProcess
  • tst_QProcessEnvironment
  • tst_Selftests
10-301
280 const char *equal = strchr(entry, '=');-
281 if (!equal)
!equalDescription
TRUEnever evaluated
FALSEevaluated 301 times by 3 tests
Evaluated by:
  • tst_QProcess
  • tst_QProcessEnvironment
  • tst_Selftests
0-301
282 continue;
never executed: continue;
0
283-
284 QByteArray name(entry, equal - entry);-
285 QByteArray value(equal + 1);-
286 env.d->hash.insert(QProcessEnvironmentPrivate::Key(name),-
287 QProcessEnvironmentPrivate::Value(value));-
288 }
executed 301 times by 3 tests: end of block
Executed by:
  • tst_QProcess
  • tst_QProcessEnvironment
  • tst_Selftests
301
289#endif-
290 return env;
executed 10 times by 3 tests: return env;
Executed by:
  • tst_QProcess
  • tst_QProcessEnvironment
  • tst_Selftests
10
291}-
292-
293static char **_q_dupEnvironment(const QProcessEnvironmentPrivate::Hash &environment, int *envc)-
294{-
295 *envc = 0;-
296 if (environment.isEmpty())
environment.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 994 times by 6 tests
Evaluated by:
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
0-994
297 return 0;
never executed: return 0;
0
298-
299 char **envp = new char *[environment.count() + 2];-
300 envp[environment.count()] = 0;-
301 envp[environment.count() + 1] = 0;-
302-
303 QProcessEnvironmentPrivate::Hash::ConstIterator it = environment.constBegin();-
304 const QProcessEnvironmentPrivate::Hash::ConstIterator end = environment.constEnd();-
305 for ( ; it != end; ++it) {
it != endDescription
TRUEevaluated 14601 times by 6 tests
Evaluated by:
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
FALSEevaluated 994 times by 6 tests
Evaluated by:
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
994-14601
306 QByteArray key = it.key().key;-
307 QByteArray value = it.value().bytes();-
308 key.reserve(key.length() + 1 + value.length());-
309 key.append('=');-
310 key.append(value);-
311-
312 envp[(*envc)++] = ::strdup(key.constData());-
313 }
executed 14601 times by 6 tests: end of block
Executed by:
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
14601
314-
315 return envp;
executed 994 times by 6 tests: return envp;
Executed by:
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
994
316}-
317-
318void QProcessPrivate::startProcess()-
319{-
320 Q_Q(QProcess);-
321-
322#if defined (QPROCESS_DEBUG)-
323 qDebug("QProcessPrivate::startProcess()");-
324#endif-
325-
326 // Initialize pipes-
327 if (!openChannel(stdinChannel) ||
!openChannel(stdinChannel)Description
TRUEnever evaluated
FALSEevaluated 2473 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_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
  • ...
0-2473
328 !openChannel(stdoutChannel) ||
!openChannel(stdoutChannel)Description
TRUEnever evaluated
FALSEevaluated 2473 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_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
  • ...
0-2473
329 !openChannel(stderrChannel) ||
!openChannel(stderrChannel)Description
TRUEnever evaluated
FALSEevaluated 2473 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_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
  • ...
0-2473
330 qt_create_pipe(childStartedPipe) != 0) {
qt_create_pipe...rtedPipe) != 0Description
TRUEnever evaluated
FALSEevaluated 2473 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_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
  • ...
0-2473
331 setErrorAndEmit(QProcess::FailedToStart, qt_error_string(errno));-
332 cleanup();-
333 return;
never executed: return;
0
334 }-
335-
336 if (threadData->hasEventDispatcher()) {
threadData->ha...ntDispatcher()Description
TRUEevaluated 2392 times by 36 tests
Evaluated by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • ...
FALSEevaluated 81 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_qdbuscpp2xml
81-2392
337 startupSocketNotifier = new QSocketNotifier(childStartedPipe[0],-
338 QSocketNotifier::Read, q);-
339 QObject::connect(startupSocketNotifier, SIGNAL(activated(int)),-
340 q, SLOT(_q_startupNotification()));-
341 }
executed 2392 times by 36 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • ...
2392
342-
343 // Start the process (platform dependent)-
344 q->setProcessState(QProcess::Starting);-
345-
346 // Create argument list with right number of elements, and set the final-
347 // one to 0.-
348 char **argv = new char *[arguments.count() + 2];-
349 argv[arguments.count() + 1] = 0;-
350-
351 // Encode the program name.-
352 QByteArray encodedProgramName = QFile::encodeName(program);-
353#ifdef Q_OS_MAC-
354 // allow invoking of .app bundles on the Mac.-
355 QFileInfo fileInfo(program);-
356 if (encodedProgramName.endsWith(".app") && fileInfo.isDir()) {-
357 QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(0,-
358 QCFString(fileInfo.absoluteFilePath()),-
359 kCFURLPOSIXPathStyle, true);-
360 {-
361 // CFBundle is not reentrant, since CFBundleCreate might return a reference-
362 // to a cached bundle object. Protect the bundle calls with a mutex lock.-
363 static QBasicMutex cfbundleMutex;-
364 QMutexLocker lock(&cfbundleMutex);-
365 QCFType<CFBundleRef> bundle = CFBundleCreate(0, url);-
366 // 'executableURL' can be either relative or absolute ...-
367 QCFType<CFURLRef> executableURL = CFBundleCopyExecutableURL(bundle);-
368 // not to depend on caching - make sure it's always absolute.-
369 url = CFURLCopyAbsoluteURL(executableURL);-
370 }-
371 if (url) {-
372 const QCFString str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);-
373 encodedProgramName += (QDir::separator() + QDir(program).relativeFilePath(QCFString::toQString(str))).toUtf8();-
374 }-
375 }-
376#endif-
377-
378 // Add the program name to the argument list.-
379 char *dupProgramName = ::strdup(encodedProgramName.constData());-
380 argv[0] = dupProgramName;-
381-
382 // Add every argument to the list-
383 for (int i = 0; i < arguments.count(); ++i)
i < arguments.count()Description
TRUEevaluated 4043 times by 26 tests
Evaluated by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_rcc
  • ...
FALSEevaluated 2473 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_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
  • ...
2473-4043
384 argv[i + 1] = ::strdup(QFile::encodeName(arguments.at(i)).constData());
executed 4043 times by 26 tests: argv[i + 1] = ::strdup(QFile::encodeName(arguments.at(i)).constData());
Executed by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_rcc
  • ...
4043
385-
386 // Duplicate the environment.-
387 int envc = 0;-
388 char **envp = 0;-
389 if (environment.d.constData()) {
environment.d.constData()Description
TRUEevaluated 994 times by 6 tests
Evaluated by:
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
FALSEevaluated 1479 times by 34 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_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
  • ...
994-1479
390 QProcessEnvironmentPrivate::MutexLocker locker(environment.d);-
391 envp = _q_dupEnvironment(environment.d.constData()->hash, &envc);-
392 }
executed 994 times by 6 tests: end of block
Executed by:
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
994
393-
394 // Encode the working directory if it's non-empty, otherwise just pass 0.-
395 const char *workingDirPtr = 0;-
396 QByteArray encodedWorkingDirectory;-
397 if (!workingDirectory.isEmpty()) {
!workingDirectory.isEmpty()Description
TRUEevaluated 263 times by 4 tests
Evaluated by:
  • tst_Lancelot
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qmakelib
FALSEevaluated 2210 times by 36 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_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextStream
  • tst_QUdpSocket
  • ...
263-2210
398 encodedWorkingDirectory = QFile::encodeName(workingDirectory);-
399 workingDirPtr = encodedWorkingDirectory.constData();-
400 }
executed 263 times by 4 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qmakelib
263
401-
402 // If the program does not specify a path, generate a list of possible-
403 // locations for the binary using the PATH environment variable.-
404 char **path = 0;-
405 int pathc = 0;-
406 if (!program.contains(QLatin1Char('/'))) {
!program.conta...tin1Char('/'))Description
TRUEevaluated 282 times by 7 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qmake
FALSEevaluated 2191 times by 34 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • 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
  • tst_QUuid
  • ...
282-2191
407 const QString pathEnv = QString::fromLocal8Bit(qgetenv("PATH"));-
408 if (!pathEnv.isEmpty()) {
!pathEnv.isEmpty()Description
TRUEevaluated 282 times by 7 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qmake
FALSEnever evaluated
0-282
409 QStringList pathEntries = pathEnv.split(QLatin1Char(':'), QString::SkipEmptyParts);-
410 if (!pathEntries.isEmpty()) {
!pathEntries.isEmpty()Description
TRUEevaluated 282 times by 7 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qmake
FALSEnever evaluated
0-282
411 pathc = pathEntries.size();-
412 path = new char *[pathc + 1];-
413 path[pathc] = 0;-
414-
415 for (int k = 0; k < pathEntries.size(); ++k) {
k < pathEntries.size()Description
TRUEevaluated 3666 times by 7 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qmake
FALSEevaluated 282 times by 7 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qmake
282-3666
416 QByteArray tmp = QFile::encodeName(pathEntries.at(k));-
417 if (!tmp.endsWith('/')) tmp += '/';
executed 3666 times by 7 tests: tmp += '/';
Executed by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qmake
!tmp.endsWith('/')Description
TRUEevaluated 3666 times by 7 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qmake
FALSEnever evaluated
0-3666
418 tmp += encodedProgramName;-
419 path[k] = ::strdup(tmp.constData());-
420 }
executed 3666 times by 7 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qmake
3666
421 }
executed 282 times by 7 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qmake
282
422 }
executed 282 times by 7 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qmake
282
423 }
executed 282 times by 7 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qmake
282
424-
425 // Start the process manager, and fork off the child process.-
426 pid_t childPid;-
427 forkfd = ::forkfd(FFD_CLOEXEC, &childPid);-
428 int lastForkErrno = errno;-
429 if (forkfd != FFD_CHILD_PROCESS) {
forkfd != (-2)Description
TRUEevaluated 2473 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_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
  • ...
FALSEnever evaluated
0-2473
430 // Parent process.-
431 // Clean up duplicated memory.-
432 free(dupProgramName);-
433 for (int i = 1; i <= arguments.count(); ++i)
i <= arguments.count()Description
TRUEevaluated 4043 times by 26 tests
Evaluated by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_rcc
  • ...
FALSEevaluated 2473 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_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
  • ...
2473-4043
434 free(argv[i]);
executed 4043 times by 26 tests: free(argv[i]);
Executed by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_rcc
  • ...
4043
435 for (int i = 0; i < envc; ++i)
i < envcDescription
TRUEevaluated 14601 times by 6 tests
Evaluated by:
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
FALSEevaluated 2473 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_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
  • ...
2473-14601
436 free(envp[i]);
executed 14601 times by 6 tests: free(envp[i]);
Executed by:
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
14601
437 for (int i = 0; i < pathc; ++i)
i < pathcDescription
TRUEevaluated 3666 times by 7 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qmake
FALSEevaluated 2473 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_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
  • ...
2473-3666
438 free(path[i]);
executed 3666 times by 7 tests: free(path[i]);
Executed by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qmake
3666
439 delete [] argv;-
440 delete [] envp;-
441 delete [] path;-
442 }
executed 2473 times by 38 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_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
  • ...
2473
443-
444 // On QNX, if spawnChild failed, childPid will be -1 but forkfd is still 0.-
445 // This is intentional because we only want to handle failure to fork()-
446 // here, which is a rare occurrence. Handling of the failure to start is-
447 // done elsewhere.-
448 if (forkfd == -1) {
forkfd == -1Description
TRUEnever evaluated
FALSEevaluated 2473 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_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
  • ...
0-2473
449 // Cleanup, report error and return-
450#if defined (QPROCESS_DEBUG)-
451 qDebug("fork failed: %s", qPrintable(qt_error_string(lastForkErrno)));-
452#endif-
453 q->setProcessState(QProcess::NotRunning);-
454 setErrorAndEmit(QProcess::FailedToStart,-
455 QProcess::tr("Resource error (fork failure): %1").arg(qt_error_string(lastForkErrno)));-
456 cleanup();-
457 return;
never executed: return;
0
458 }-
459-
460 // Start the child.-
461 if (forkfd == FFD_CHILD_PROCESS) {
forkfd == (-2)Description
TRUEnever evaluated
FALSEevaluated 2473 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_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
  • ...
0-2473
462 execChild(workingDirPtr, path, argv, envp);-
463 ::_exit(-1);-
464 }
never executed: end of block
0
465-
466 pid = Q_PID(childPid);-
467-
468 // parent-
469 // close the ends we don't use and make all pipes non-blocking-
470 qt_safe_close(childStartedPipe[1]);-
471 childStartedPipe[1] = -1;-
472-
473 if (stdinChannel.pipe[0] != -1) {
stdinChannel.pipe[0] != -1Description
TRUEevaluated 2473 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_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
  • ...
FALSEnever evaluated
0-2473
474 qt_safe_close(stdinChannel.pipe[0]);-
475 stdinChannel.pipe[0] = -1;-
476 }
executed 2473 times by 38 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_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
  • ...
2473
477-
478 if (stdinChannel.pipe[1] != -1)
stdinChannel.pipe[1] != -1Description
TRUEevaluated 2468 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_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
  • ...
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QProcess
5-2468
479 ::fcntl(stdinChannel.pipe[1], F_SETFL, ::fcntl(stdinChannel.pipe[1], F_GETFL) | O_NONBLOCK);
executed 2468 times by 38 tests: ::fcntl(stdinChannel.pipe[1], 4, ::fcntl(stdinChannel.pipe[1], 3) | 04000);
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_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
  • ...
2468
480-
481 if (stdoutChannel.pipe[1] != -1) {
stdoutChannel.pipe[1] != -1Description
TRUEevaluated 2473 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_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
  • ...
FALSEnever evaluated
0-2473
482 qt_safe_close(stdoutChannel.pipe[1]);-
483 stdoutChannel.pipe[1] = -1;-
484 }
executed 2473 times by 38 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_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
  • ...
2473
485-
486 if (stdoutChannel.pipe[0] != -1)
stdoutChannel.pipe[0] != -1Description
TRUEevaluated 2463 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_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
  • ...
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_QProcess
10-2463
487 ::fcntl(stdoutChannel.pipe[0], F_SETFL, ::fcntl(stdoutChannel.pipe[0], F_GETFL) | O_NONBLOCK);
executed 2463 times by 38 tests: ::fcntl(stdoutChannel.pipe[0], 4, ::fcntl(stdoutChannel.pipe[0], 3) | 04000);
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_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
  • ...
2463
488-
489 if (stderrChannel.pipe[1] != -1) {
stderrChannel.pipe[1] != -1Description
TRUEevaluated 2457 times by 37 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_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
  • tst_QUdpSocket
  • ...
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QProcess
16-2457
490 qt_safe_close(stderrChannel.pipe[1]);-
491 stderrChannel.pipe[1] = -1;-
492 }
executed 2457 times by 37 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_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
  • tst_QUdpSocket
  • ...
2457
493 if (stderrChannel.pipe[0] != -1)
stderrChannel.pipe[0] != -1Description
TRUEevaluated 2454 times by 37 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_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
  • tst_QUdpSocket
  • ...
FALSEevaluated 19 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QProcess
19-2454
494 ::fcntl(stderrChannel.pipe[0], F_SETFL, ::fcntl(stderrChannel.pipe[0], F_GETFL) | O_NONBLOCK);
executed 2454 times by 37 tests: ::fcntl(stderrChannel.pipe[0], 4, ::fcntl(stderrChannel.pipe[0], 3) | 04000);
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_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
  • tst_QUdpSocket
  • ...
2454
495-
496 if (threadData->eventDispatcher) {
threadData->eventDispatcherDescription
TRUEevaluated 2392 times by 36 tests
Evaluated by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • ...
FALSEevaluated 81 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_qdbuscpp2xml
81-2392
497 deathNotifier = new QSocketNotifier(forkfd, QSocketNotifier::Read, q);-
498 QObject::connect(deathNotifier, SIGNAL(activated(int)),-
499 q, SLOT(_q_processDied()));-
500 }
executed 2392 times by 36 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • ...
2392
501}
executed 2473 times by 38 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_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
  • ...
2473
502-
503void QProcessPrivate::execChild(const char *workingDir, char **path, char **argv, char **envp)-
504{-
505 ::signal(SIGPIPE, SIG_DFL); // reset the signal that we ignored-
506-
507 Q_Q(QProcess);-
508-
509 // copy the stdin socket if asked to (without closing on exec)-
510 if (inputChannelMode != QProcess::ForwardedInputChannel)
inputChannelMo...edInputChannelDescription
TRUEnever evaluated
FALSEnever evaluated
0
511 qt_safe_dup2(stdinChannel.pipe[0], STDIN_FILENO, 0);
never executed: qt_safe_dup2(stdinChannel.pipe[0], 0, 0);
0
512-
513 // copy the stdout and stderr if asked to-
514 if (processChannelMode != QProcess::ForwardedChannels) {
processChannel...wardedChannelsDescription
TRUEnever evaluated
FALSEnever evaluated
0
515 if (processChannelMode != QProcess::ForwardedOutputChannel)
processChannel...dOutputChannelDescription
TRUEnever evaluated
FALSEnever evaluated
0
516 qt_safe_dup2(stdoutChannel.pipe[1], STDOUT_FILENO, 0);
never executed: qt_safe_dup2(stdoutChannel.pipe[1], 1, 0);
0
517-
518 // merge stdout and stderr if asked to-
519 if (processChannelMode == QProcess::MergedChannels) {
processChannel...MergedChannelsDescription
TRUEnever evaluated
FALSEnever evaluated
0
520 qt_safe_dup2(STDOUT_FILENO, STDERR_FILENO, 0);-
521 } else if (processChannelMode != QProcess::ForwardedErrorChannel) {
never executed: end of block
processChannel...edErrorChannelDescription
TRUEnever evaluated
FALSEnever evaluated
0
522 qt_safe_dup2(stderrChannel.pipe[1], STDERR_FILENO, 0);-
523 }
never executed: end of block
0
524 }
never executed: end of block
0
525-
526 // make sure this fd is closed if execvp() succeeds-
527 qt_safe_close(childStartedPipe[0]);-
528-
529 // enter the working directory-
530 if (workingDir && QT_CHDIR(workingDir) == -1) {
workingDirDescription
TRUEnever evaluated
FALSEnever evaluated
::chdir(workingDir) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
531 // failed, stop the process-
532 goto report_errno;
never executed: goto report_errno;
0
533 }-
534-
535 // this is a virtual call, and it base behavior is to do nothing.-
536 q->setupChildProcess();-
537-
538 // execute the process-
539 if (!envp) {
!envpDescription
TRUEnever evaluated
FALSEnever evaluated
0
540 qt_safe_execvp(argv[0], argv);-
541 } else {
never executed: end of block
0
542 if (path) {
pathDescription
TRUEnever evaluated
FALSEnever evaluated
0
543 char **arg = path;-
544 while (*arg) {
*argDescription
TRUEnever evaluated
FALSEnever evaluated
0
545 argv[0] = *arg;-
546#if defined (QPROCESS_DEBUG)-
547 fprintf(stderr, "QProcessPrivate::execChild() searching / starting %s\n", argv[0]);-
548#endif-
549 qt_safe_execve(argv[0], argv, envp);-
550 ++arg;-
551 }
never executed: end of block
0
552 } else {
never executed: end of block
0
553#if defined (QPROCESS_DEBUG)-
554 fprintf(stderr, "QProcessPrivate::execChild() starting %s\n", argv[0]);-
555#endif-
556 qt_safe_execve(argv[0], argv, envp);-
557 }
never executed: end of block
0
558 }-
559-
560 // notify failure-
561report_errno:
code before this statement never executed: report_errno:
0
562 QString error = qt_error_string(errno);-
563#if defined (QPROCESS_DEBUG)-
564 fprintf(stderr, "QProcessPrivate::execChild() failed (%s), notifying parent process\n", qPrintable(error));-
565#endif-
566 qt_safe_write(childStartedPipe[1], error.data(), error.length() * sizeof(QChar));-
567 qt_safe_close(childStartedPipe[1]);-
568 childStartedPipe[1] = -1;-
569}
never executed: end of block
0
570-
571bool QProcessPrivate::processStarted(QString *errorMessage)-
572{-
573 ushort buf[errorBufferMax];-
574 int i = qt_safe_read(childStartedPipe[0], &buf, sizeof buf);-
575 if (startupSocketNotifier) {
startupSocketNotifierDescription
TRUEevaluated 2392 times by 36 tests
Evaluated by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • ...
FALSEevaluated 81 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_qdbuscpp2xml
81-2392
576 startupSocketNotifier->setEnabled(false);-
577 startupSocketNotifier->deleteLater();-
578 startupSocketNotifier = 0;-
579 }
executed 2392 times by 36 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • ...
2392
580 qt_safe_close(childStartedPipe[0]);-
581 childStartedPipe[0] = -1;-
582-
583#if defined (QPROCESS_DEBUG)-
584 qDebug("QProcessPrivate::processStarted() == %s", i <= 0 ? "true" : "false");-
585#endif-
586-
587 // did we read an error message?-
588 if ((i > 0) && errorMessage)
(i > 0)Description
TRUEevaluated 704 times by 11 tests
Evaluated by:
  • tst_QCommandLineParser
  • tst_QFile
  • tst_QLockFile
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
FALSEevaluated 1769 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_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
  • tst_qmakelib
  • ...
errorMessageDescription
TRUEevaluated 704 times by 11 tests
Evaluated by:
  • tst_QCommandLineParser
  • tst_QFile
  • tst_QLockFile
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
FALSEnever evaluated
0-1769
589 *errorMessage = QString((const QChar *)buf, i / sizeof(QChar));
executed 704 times by 11 tests: *errorMessage = QString((const QChar *)buf, i / sizeof(QChar));
Executed by:
  • tst_QCommandLineParser
  • tst_QFile
  • tst_QLockFile
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
704
590-
591 return i <= 0;
executed 2473 times by 38 tests: return i <= 0;
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_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
  • ...
2473
592}-
593-
594qint64 QProcessPrivate::bytesAvailableInChannel(const Channel *channel) const-
595{-
596 Q_ASSERT(channel->pipe[0] != INVALID_Q_PIPE);-
597 int nbytes = 0;-
598 qint64 available = 0;-
599 if (::ioctl(channel->pipe[0], FIONREAD, (char *) &nbytes) >= 0)
::ioctl(channe... &nbytes) >= 0Description
TRUEevaluated 38181 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_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
  • tst_qmakelib
  • ...
FALSEnever evaluated
0-38181
600 available = (qint64) nbytes;
executed 38181 times by 29 tests: available = (qint64) nbytes;
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • 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
  • tst_qmakelib
  • ...
38181
601#if defined (QPROCESS_DEBUG)-
602 qDebug("QProcessPrivate::bytesAvailableInChannel(%d) == %lld", int(channel - &stdinChannel), available);-
603#endif-
604 return available;
executed 38181 times by 29 tests: return 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_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
  • tst_qmakelib
  • ...
38181
605}-
606-
607qint64 QProcessPrivate::readFromChannel(const Channel *channel, char *data, qint64 maxlen)-
608{-
609 Q_ASSERT(channel->pipe[0] != INVALID_Q_PIPE);-
610 qint64 bytesRead = qt_safe_read(channel->pipe[0], data, maxlen);-
611#if defined QPROCESS_DEBUG-
612 int save_errno = errno;-
613 qDebug("QProcessPrivate::readFromChannel(%d, %p \"%s\", %lld) == %lld",-
614 int(channel - &stdinChannel),-
615 data, qt_prettyDebug(data, bytesRead, 16).constData(), maxlen, bytesRead);-
616 errno = save_errno;-
617#endif-
618 if (bytesRead == -1 && errno == EWOULDBLOCK)
bytesRead == -1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 38179 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_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
  • tst_qmakelib
  • ...
(*__errno_location ()) == 11Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEnever evaluated
0-38179
619 return -2;
executed 2 times by 1 test: return -2;
Executed by:
  • tst_QProcess
2
620 return bytesRead;
executed 38179 times by 29 tests: return bytesRead;
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • 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
  • tst_qmakelib
  • ...
38179
621}-
622-
623bool QProcessPrivate::writeToStdin()-
624{-
625 const char *data = stdinChannel.buffer.readPointer();-
626 const qint64 bytesToWrite = stdinChannel.buffer.nextDataBlockSize();-
627-
628 qint64 written = qt_safe_write_nosignal(stdinChannel.pipe[1], data, bytesToWrite);-
629#if defined QPROCESS_DEBUG-
630 qDebug("QProcessPrivate::writeToStdin(), write(%p \"%s\", %lld) == %lld",-
631 data, qt_prettyDebug(data, bytesToWrite, 16).constData(), bytesToWrite, written);-
632 if (written == -1)-
633 qDebug("QProcessPrivate::writeToStdin(), failed to write (%s)", qPrintable(qt_error_string(errno)));-
634#endif-
635 if (written == -1) {
written == -1Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 624 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
5-624
636 // If the O_NONBLOCK flag is set and If some data can be written without blocking-
637 // the process, write() will transfer what it can and return the number of bytes written.-
638 // Otherwise, it will return -1 and set errno to EAGAIN-
639 if (errno == EAGAIN)
(*__errno_location ()) == 11Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QProcess
0-5
640 return true;
never executed: return true;
0
641-
642 closeChannel(&stdinChannel);-
643 setErrorAndEmit(QProcess::WriteError);-
644 return false;
executed 5 times by 1 test: return false;
Executed by:
  • tst_QProcess
5
645 }-
646 stdinChannel.buffer.free(written);-
647 if (!emittedBytesWritten && written != 0) {
!emittedBytesWrittenDescription
TRUEevaluated 623 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QProcess
written != 0Description
TRUEevaluated 623 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-623
648 emittedBytesWritten = true;-
649 emit q_func()->bytesWritten(written);-
650 emittedBytesWritten = false;-
651 }
executed 623 times by 6 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
623
652 return true;
executed 624 times by 6 tests: return true;
Executed by:
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
624
653}-
654-
655void QProcessPrivate::terminateProcess()-
656{-
657#if defined (QPROCESS_DEBUG)-
658 qDebug("QProcessPrivate::terminateProcess()");-
659#endif-
660 if (pid)
pidDescription
TRUEevaluated 12 times by 3 tests
Evaluated by:
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QProcess
FALSEnever evaluated
0-12
661 ::kill(pid_t(pid), SIGTERM);
executed 12 times by 3 tests: ::kill(pid_t(pid), 15);
Executed by:
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QProcess
12
662}
executed 12 times by 3 tests: end of block
Executed by:
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QProcess
12
663-
664void QProcessPrivate::killProcess()-
665{-
666#if defined (QPROCESS_DEBUG)-
667 qDebug("QProcessPrivate::killProcess()");-
668#endif-
669 if (pid)
pidDescription
TRUEevaluated 11 times by 3 tests
Evaluated by:
  • tst_QNetworkSession
  • tst_QProcess
  • tst_QSystemSemaphore
FALSEevaluated 4 times by 4 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
4-11
670 ::kill(pid_t(pid), SIGKILL);
executed 11 times by 3 tests: ::kill(pid_t(pid), 9);
Executed by:
  • tst_QNetworkSession
  • tst_QProcess
  • tst_QSystemSemaphore
11
671}
executed 15 times by 7 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QNetworkSession
  • tst_QProcess
  • tst_QSystemSemaphore
15
672-
673bool QProcessPrivate::waitForStarted(int msecs)-
674{-
675#if defined (QPROCESS_DEBUG)-
676 qDebug("QProcessPrivate::waitForStarted(%d) waiting for child to start (fd = %d)", msecs,-
677 childStartedPipe[0]);-
678#endif-
679-
680 fd_set fds;-
681 FD_ZERO(&fds);-
682 FD_SET(childStartedPipe[0], &fds);-
683 if (qt_select_msecs(childStartedPipe[0] + 1, &fds, 0, msecs) == 0) {
qt_select_msec...0, msecs) == 0Description
TRUEnever evaluated
FALSEevaluated 2246 times by 36 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • ...
0-2246
684 setError(QProcess::Timedout);-
685#if defined (QPROCESS_DEBUG)-
686 qDebug("QProcessPrivate::waitForStarted(%d) == false (timed out)", msecs);-
687#endif-
688 return false;
never executed: return false;
0
689 }-
690-
691 bool startedEmitted = _q_startupNotification();-
692#if defined (QPROCESS_DEBUG)-
693 qDebug("QProcessPrivate::waitForStarted() == %s", startedEmitted ? "true" : "false");-
694#endif-
695 return startedEmitted;
executed 2246 times by 36 tests: return startedEmitted;
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • 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
  • ...
2246
696}-
697-
698#ifdef Q_OS_BLACKBERRY-
699QList<QSocketNotifier *> QProcessPrivate::defaultNotifiers() const-
700{-
701 QList<QSocketNotifier *> notifiers;-
702 notifiers << stdoutChannel.notifier-
703 << stderrChannel.notifier-
704 << stdinChannel.notifier;-
705 return notifiers;-
706}-
707#endif // Q_OS_BLACKBERRY-
708-
709bool QProcessPrivate::waitForReadyRead(int msecs)-
710{-
711#if defined (QPROCESS_DEBUG)-
712 qDebug("QProcessPrivate::waitForReadyRead(%d)", msecs);-
713#endif-
714-
715 QElapsedTimer stopWatch;-
716 stopWatch.start();-
717-
718#ifdef Q_OS_BLACKBERRY-
719 QList<QSocketNotifier *> notifiers = defaultNotifiers();-
720#endif-
721-
722 forever {-
723 fd_set fdread;-
724 fd_set fdwrite;-
725-
726 FD_ZERO(&fdread);-
727 FD_ZERO(&fdwrite);-
728-
729 int nfds = forkfd;-
730 FD_SET(forkfd, &fdread);-
731-
732 if (processState == QProcess::Starting)
processState =...cess::StartingDescription
TRUEevaluated 115 times by 4 tests
Evaluated by:
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QProcess
  • tst_QTextStream
FALSEevaluated 892 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
115-892
733 add_fd(nfds, childStartedPipe[0], &fdread);
executed 115 times by 4 tests: add_fd(nfds, childStartedPipe[0], &fdread);
Executed by:
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QProcess
  • tst_QTextStream
115
734-
735 if (stdoutChannel.pipe[0] != -1)
stdoutChannel.pipe[0] != -1Description
TRUEevaluated 1006 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
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QProcess
1-1006
736 add_fd(nfds, stdoutChannel.pipe[0], &fdread);
executed 1006 times by 9 tests: add_fd(nfds, stdoutChannel.pipe[0], &fdread);
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
1006
737 if (stderrChannel.pipe[0] != -1)
stderrChannel.pipe[0] != -1Description
TRUEevaluated 663 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
FALSEevaluated 344 times by 5 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
344-663
738 add_fd(nfds, stderrChannel.pipe[0], &fdread);
executed 663 times by 9 tests: add_fd(nfds, stderrChannel.pipe[0], &fdread);
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
663
739-
740 if (!stdinChannel.buffer.isEmpty() && stdinChannel.pipe[1] != -1)
!stdinChannel.buffer.isEmpty()Description
TRUEevaluated 217 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_QTextStream
FALSEevaluated 790 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
stdinChannel.pipe[1] != -1Description
TRUEevaluated 217 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_QTextStream
FALSEnever evaluated
0-790
741 add_fd(nfds, stdinChannel.pipe[1], &fdwrite);
executed 217 times by 2 tests: add_fd(nfds, stdinChannel.pipe[1], &fdwrite);
Executed by:
  • tst_QProcess
  • tst_QTextStream
217
742-
743 int timeout = qt_subtract_from_timeout(msecs, stopWatch.elapsed());-
744#ifdef Q_OS_BLACKBERRY-
745 int ret = bb_select(notifiers, nfds + 1, &fdread, &fdwrite, timeout);-
746#else-
747 int ret = qt_select_msecs(nfds + 1, &fdread, &fdwrite, timeout);-
748#endif-
749 if (ret < 0) {
ret < 0Description
TRUEnever evaluated
FALSEevaluated 1007 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
0-1007
750 break;
never executed: break;
0
751 }-
752 if (ret == 0) {
ret == 0Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 1002 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
5-1002
753 setError(QProcess::Timedout);-
754 return false;
executed 5 times by 1 test: return false;
Executed by:
  • tst_QProcess
5
755 }-
756-
757 if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) {
childStartedPipe[0] != -1Description
TRUEevaluated 115 times by 4 tests
Evaluated by:
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QProcess
  • tst_QTextStream
FALSEevaluated 887 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
((((&fdread)->...ask))))) != 0)Description
TRUEevaluated 113 times by 4 tests
Evaluated by:
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QProcess
  • tst_QTextStream
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_QTextStream
2-887
758 if (!_q_startupNotification())
!_q_startupNotification()Description
TRUEevaluated 102 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_QTextStream
FALSEevaluated 11 times by 3 tests
Evaluated by:
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QProcess
11-102
759 return false;
executed 102 times by 2 tests: return false;
Executed by:
  • tst_QProcess
  • tst_QTextStream
102
760 }
executed 11 times by 3 tests: end of block
Executed by:
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QProcess
11
761-
762 bool readyReadEmitted = false;-
763 if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread)) {
stdoutChannel.pipe[0] != -1Description
TRUEevaluated 899 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
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QProcess
((((&fdread)->...ask))))) != 0)Description
TRUEevaluated 620 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 279 times by 8 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QTextStream
1-899
764 bool canRead = _q_canReadStandardOutput();-
765 if (processChannel == QProcess::StandardOutput && canRead)
processChannel...StandardOutputDescription
TRUEevaluated 605 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 15 times by 1 test
Evaluated by:
  • tst_QProcess
canReadDescription
TRUEevaluated 604 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 1 time by 1 test
Evaluated by:
  • tst_QProcess
1-605
766 readyReadEmitted = true;
executed 604 times by 8 tests: readyReadEmitted = true;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
604
767 }
executed 620 times by 8 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
620
768 if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread)) {
stderrChannel.pipe[0] != -1Description
TRUEevaluated 556 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
FALSEevaluated 344 times by 5 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
((((&fdread)->...ask))))) != 0)Description
TRUEevaluated 52 times by 5 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
FALSEevaluated 504 times by 5 tests
Evaluated by:
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QTextStream
52-556
769 bool canRead = _q_canReadStandardError();-
770 if (processChannel == QProcess::StandardError && canRead)
processChannel...:StandardErrorDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 30 times by 5 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
canReadDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEnever evaluated
0-30
771 readyReadEmitted = true;
executed 22 times by 1 test: readyReadEmitted = true;
Executed by:
  • tst_QProcess
22
772 }
executed 52 times by 5 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
52
773 if (readyReadEmitted)
readyReadEmittedDescription
TRUEevaluated 626 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 274 times by 8 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QTextStream
274-626
774 return true;
executed 626 times by 8 tests: return true;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
626
775-
776 if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite))
stdinChannel.pipe[1] != -1Description
TRUEevaluated 270 times by 8 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QTextStream
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QProcess
((((&fdwrite)-...ask))))) != 0)Description
TRUEevaluated 217 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_QTextStream
FALSEevaluated 53 times by 7 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
4-270
777 _q_canWrite();
executed 217 times by 2 tests: _q_canWrite();
Executed by:
  • tst_QProcess
  • tst_QTextStream
217
778-
779 if (forkfd == -1 || FD_ISSET(forkfd, &fdread)) {
forkfd == -1Description
TRUEnever evaluated
FALSEevaluated 274 times by 8 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QTextStream
((((&fdread)->...ask))))) != 0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 273 times by 8 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QTextStream
0-274
780 if (_q_processDied())
_q_processDied()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QProcess
FALSEnever evaluated
0-1
781 return false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QProcess
1
782 }
never executed: end of block
0
783 }
executed 273 times by 8 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QProcess
  • tst_QTextStream
273
784 return false;
never executed: return false;
0
785}-
786-
787bool QProcessPrivate::waitForBytesWritten(int msecs)-
788{-
789#if defined (QPROCESS_DEBUG)-
790 qDebug("QProcessPrivate::waitForBytesWritten(%d)", msecs);-
791#endif-
792-
793 QElapsedTimer stopWatch;-
794 stopWatch.start();-
795-
796#ifdef Q_OS_BLACKBERRY-
797 QList<QSocketNotifier *> notifiers = defaultNotifiers();-
798#endif-
799-
800 while (!stdinChannel.buffer.isEmpty()) {
!stdinChannel.buffer.isEmpty()Description
TRUEevaluated 151 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_qdbusxml2cpp
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QProcess
1-151
801 fd_set fdread;-
802 fd_set fdwrite;-
803-
804 FD_ZERO(&fdread);-
805 FD_ZERO(&fdwrite);-
806-
807 int nfds = forkfd;-
808 FD_SET(forkfd, &fdread);-
809-
810 if (processState == QProcess::Starting)
processState =...cess::StartingDescription
TRUEnever evaluated
FALSEevaluated 151 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_qdbusxml2cpp
0-151
811 add_fd(nfds, childStartedPipe[0], &fdread);
never executed: add_fd(nfds, childStartedPipe[0], &fdread);
0
812-
813 if (stdoutChannel.pipe[0] != -1)
stdoutChannel.pipe[0] != -1Description
TRUEevaluated 149 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_qdbusxml2cpp
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QProcess
2-149
814 add_fd(nfds, stdoutChannel.pipe[0], &fdread);
executed 149 times by 2 tests: add_fd(nfds, stdoutChannel.pipe[0], &fdread);
Executed by:
  • tst_QProcess
  • tst_qdbusxml2cpp
149
815 if (stderrChannel.pipe[0] != -1)
stderrChannel.pipe[0] != -1Description
TRUEevaluated 151 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_qdbusxml2cpp
FALSEnever evaluated
0-151
816 add_fd(nfds, stderrChannel.pipe[0], &fdread);
executed 151 times by 2 tests: add_fd(nfds, stderrChannel.pipe[0], &fdread);
Executed by:
  • tst_QProcess
  • tst_qdbusxml2cpp
151
817-
818-
819 if (!stdinChannel.buffer.isEmpty() && stdinChannel.pipe[1] != -1)
!stdinChannel.buffer.isEmpty()Description
TRUEevaluated 151 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_qdbusxml2cpp
FALSEnever evaluated
stdinChannel.pipe[1] != -1Description
TRUEevaluated 151 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_qdbusxml2cpp
FALSEnever evaluated
0-151
820 add_fd(nfds, stdinChannel.pipe[1], &fdwrite);
executed 151 times by 2 tests: add_fd(nfds, stdinChannel.pipe[1], &fdwrite);
Executed by:
  • tst_QProcess
  • tst_qdbusxml2cpp
151
821-
822 int timeout = qt_subtract_from_timeout(msecs, stopWatch.elapsed());-
823#ifdef Q_OS_BLACKBERRY-
824 int ret = bb_select(notifiers, nfds + 1, &fdread, &fdwrite, timeout);-
825#else-
826 int ret = qt_select_msecs(nfds + 1, &fdread, &fdwrite, timeout);-
827#endif-
828 if (ret < 0) {
ret < 0Description
TRUEnever evaluated
FALSEevaluated 151 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_qdbusxml2cpp
0-151
829 break;
never executed: break;
0
830 }-
831-
832 if (ret == 0) {
ret == 0Description
TRUEnever evaluated
FALSEevaluated 151 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_qdbusxml2cpp
0-151
833 setError(QProcess::Timedout);-
834 return false;
never executed: return false;
0
835 }-
836-
837 if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) {
childStartedPipe[0] != -1Description
TRUEnever evaluated
FALSEevaluated 151 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_qdbusxml2cpp
((((&fdread)->...ask))))) != 0)Description
TRUEnever evaluated
FALSEnever evaluated
0-151
838 if (!_q_startupNotification())
!_q_startupNotification()Description
TRUEnever evaluated
FALSEnever evaluated
0
839 return false;
never executed: return false;
0
840 }
never executed: end of block
0
841-
842 if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite))
stdinChannel.pipe[1] != -1Description
TRUEevaluated 151 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_qdbusxml2cpp
FALSEnever evaluated
((((&fdwrite)-...ask))))) != 0)Description
TRUEevaluated 151 times by 2 tests
Evaluated by:
  • tst_QProcess
  • tst_qdbusxml2cpp
FALSEnever evaluated
0-151
843 return _q_canWrite();
executed 151 times by 2 tests: return _q_canWrite();
Executed by:
  • tst_QProcess
  • tst_qdbusxml2cpp
151
844-
845 if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread))
stdoutChannel.pipe[0] != -1Description
TRUEnever evaluated
FALSEnever evaluated
((((&fdread)->...ask))))) != 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
846 _q_canReadStandardOutput();
never executed: _q_canReadStandardOutput();
0
847-
848 if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread))
stderrChannel.pipe[0] != -1Description
TRUEnever evaluated
FALSEnever evaluated
((((&fdread)->...ask))))) != 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
849 _q_canReadStandardError();
never executed: _q_canReadStandardError();
0
850-
851 if (forkfd == -1 || FD_ISSET(forkfd, &fdread)) {
forkfd == -1Description
TRUEnever evaluated
FALSEnever evaluated
((((&fdread)->...ask))))) != 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
852 if (_q_processDied())
_q_processDied()Description
TRUEnever evaluated
FALSEnever evaluated
0
853 return false;
never executed: return false;
0
854 }
never executed: end of block
0
855 }
never executed: end of block
0
856-
857 return false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QProcess
1
858}-
859-
860bool QProcessPrivate::waitForFinished(int msecs)-
861{-
862#if defined (QPROCESS_DEBUG)-
863 qDebug("QProcessPrivate::waitForFinished(%d)", msecs);-
864#endif-
865-
866 QElapsedTimer stopWatch;-
867 stopWatch.start();-
868-
869#ifdef Q_OS_BLACKBERRY-
870 QList<QSocketNotifier *> notifiers = defaultNotifiers();-
871#endif-
872-
873 forever {-
874 fd_set fdread;-
875 fd_set fdwrite;-
876 int nfds = -1;-
877-
878 FD_ZERO(&fdread);-
879 FD_ZERO(&fdwrite);-
880-
881 if (processState == QProcess::Starting)
processState =...cess::StartingDescription
TRUEnever evaluated
FALSEevaluated 38470 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
0-38470
882 add_fd(nfds, childStartedPipe[0], &fdread);
never executed: add_fd(nfds, childStartedPipe[0], &fdread);
0
883-
884 if (stdoutChannel.pipe[0] != -1)
stdoutChannel.pipe[0] != -1Description
TRUEevaluated 36808 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
FALSEevaluated 1662 times by 25 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • tst_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
1662-36808
885 add_fd(nfds, stdoutChannel.pipe[0], &fdread);
executed 36808 times by 28 tests: add_fd(nfds, stdoutChannel.pipe[0], &fdread);
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
36808
886 if (stderrChannel.pipe[0] != -1)
stderrChannel.pipe[0] != -1Description
TRUEevaluated 35238 times by 23 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • 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
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
FALSEevaluated 3232 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
3232-35238
887 add_fd(nfds, stderrChannel.pipe[0], &fdread);
executed 35238 times by 23 tests: add_fd(nfds, stderrChannel.pipe[0], &fdread);
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • 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
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
35238
888-
889 if (processState == QProcess::Running && forkfd != -1)
processState =...ocess::RunningDescription
TRUEevaluated 38470 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
FALSEnever evaluated
forkfd != -1Description
TRUEevaluated 38470 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
FALSEnever evaluated
0-38470
890 add_fd(nfds, forkfd, &fdread);
executed 38470 times by 28 tests: add_fd(nfds, forkfd, &fdread);
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
38470
891-
892 if (!stdinChannel.buffer.isEmpty() && stdinChannel.pipe[1] != -1)
!stdinChannel.buffer.isEmpty()Description
TRUEevaluated 78 times by 3 tests
Evaluated by:
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_qprocess - unknown status
FALSEevaluated 38392 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
stdinChannel.pipe[1] != -1Description
TRUEevaluated 73 times by 3 tests
Evaluated by:
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_qprocess - unknown status
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QProcess
5-38392
893 add_fd(nfds, stdinChannel.pipe[1], &fdwrite);
executed 73 times by 3 tests: add_fd(nfds, stdinChannel.pipe[1], &fdwrite);
Executed by:
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_qprocess - unknown status
73
894-
895 int timeout = qt_subtract_from_timeout(msecs, stopWatch.elapsed());-
896#ifdef Q_OS_BLACKBERRY-
897 int ret = bb_select(notifiers, nfds + 1, &fdread, &fdwrite, timeout);-
898#else-
899 int ret = qt_select_msecs(nfds + 1, &fdread, &fdwrite, timeout);-
900#endif-
901 if (ret < 0) {
ret < 0Description
TRUEnever evaluated
FALSEevaluated 38470 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
0-38470
902 break;
never executed: break;
0
903 }-
904 if (ret == 0) {
ret == 0Description
TRUEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSystemSemaphore
FALSEevaluated 38466 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
4-38466
905 setError(QProcess::Timedout);-
906 return false;
executed 4 times by 3 tests: return false;
Executed by:
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSystemSemaphore
4
907 }-
908-
909 if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) {
childStartedPipe[0] != -1Description
TRUEnever evaluated
FALSEevaluated 38466 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
((((&fdread)->...ask))))) != 0)Description
TRUEnever evaluated
FALSEnever evaluated
0-38466
910 if (!_q_startupNotification())
!_q_startupNotification()Description
TRUEnever evaluated
FALSEnever evaluated
0
911 return false;
never executed: return false;
0
912 }
never executed: end of block
0
913 if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite))
stdinChannel.pipe[1] != -1Description
TRUEevaluated 37133 times by 27 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_QMimeDatabase
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • ...
FALSEevaluated 1333 times by 5 tests
Evaluated by:
  • tst_QProcess
  • tst_QSharedPointer
  • tst_qdbusxml2cpp
  • tst_qprocess - unknown status
  • tst_uic
((((&fdwrite)-...ask))))) != 0)Description
TRUEevaluated 66 times by 3 tests
Evaluated by:
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_qprocess - unknown status
FALSEevaluated 37067 times by 26 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_QMimeDatabase
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedMemory
  • tst_QSharedPointer
  • tst_QSystemSemaphore
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_rcc
  • ...
66-37133
914 _q_canWrite();
executed 66 times by 3 tests: _q_canWrite();
Executed by:
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_qprocess - unknown status
66
915-
916 if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread))
stdoutChannel.pipe[0] != -1Description
TRUEevaluated 36806 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
FALSEevaluated 1660 times by 25 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • tst_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
((((&fdread)->...ask))))) != 0)Description
TRUEevaluated 34629 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
FALSEevaluated 2177 times by 22 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • 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
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
1660-36806
917 _q_canReadStandardOutput();
executed 34629 times by 28 tests: _q_canReadStandardOutput();
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
34629
918-
919 if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread))
stderrChannel.pipe[0] != -1Description
TRUEevaluated 35235 times by 23 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • 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
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
FALSEevaluated 3231 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
((((&fdread)->...ask))))) != 0)Description
TRUEevaluated 2412 times by 23 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • 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
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
FALSEevaluated 32823 times by 15 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDir
  • tst_QFont
  • 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
2412-35235
920 _q_canReadStandardError();
executed 2412 times by 23 tests: _q_canReadStandardError();
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • 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
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
2412
921-
922 if (forkfd == -1 || FD_ISSET(forkfd, &fdread)) {
forkfd == -1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 38465 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
((((&fdread)->...ask))))) != 0)Description
TRUEevaluated 1701 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
FALSEevaluated 36764 times by 25 tests
Evaluated by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • tst_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
1-38465
923 if (_q_processDied())
_q_processDied()Description
TRUEevaluated 1702 times by 28 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_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
FALSEnever evaluated
0-1702
924 return true;
executed 1702 times by 28 tests: return true;
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QFont
  • tst_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • ...
1702
925 }
never executed: end of block
0
926 }
executed 36764 times by 25 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QApplication
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDir
  • tst_QFont
  • tst_QMimeDatabase
  • 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
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
36764
927 return false;
never executed: return false;
0
928}-
929-
930bool QProcessPrivate::waitForWrite(int msecs)-
931{-
932 fd_set fdwrite;-
933 FD_ZERO(&fdwrite);-
934 FD_SET(stdinChannel.pipe[1], &fdwrite);-
935 return qt_select_msecs(stdinChannel.pipe[1] + 1, 0, &fdwrite, msecs < 0 ? 0 : msecs) == 1;
never executed: return qt_select_msecs(stdinChannel.pipe[1] + 1, 0, &fdwrite, msecs < 0 ? 0 : msecs) == 1;
0
936}-
937-
938void QProcessPrivate::findExitCode()-
939{-
940}-
941-
942bool QProcessPrivate::waitForDeadChild()-
943{-
944 if (forkfd == -1)
forkfd == -1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 2473 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_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
  • ...
1-2473
945 return true; // child has already exited
executed 1 time by 1 test: return true;
Executed by:
  • tst_QProcess
1
946-
947 // read the process information from our fd-
948 forkfd_info info;-
949 int ret;-
950 EINTR_LOOP(ret, forkfd_wait(forkfd, &info, Q_NULLPTR));
executed 3176 times by 38 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_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
  • ...
ret == -1Description
TRUEevaluated 703 times by 11 tests
Evaluated by:
  • tst_QCommandLineParser
  • tst_QFile
  • tst_QLockFile
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
FALSEevaluated 2473 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_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
  • ...
(*__errno_location ()) == 4Description
TRUEevaluated 703 times by 11 tests
Evaluated by:
  • tst_QCommandLineParser
  • tst_QFile
  • tst_QLockFile
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_QUndoGroup
  • tst_QUndoStack
FALSEnever evaluated
0-3176
951-
952 exitCode = info.status;-
953 crashed = info.code != CLD_EXITED;-
954-
955 delete deathNotifier;-
956 deathNotifier = 0;-
957-
958 EINTR_LOOP(ret, forkfd_close(forkfd));
executed 2473 times by 38 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_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
  • ...
ret == -1Description
TRUEnever evaluated
FALSEevaluated 2473 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_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
  • ...
(*__errno_location ()) == 4Description
TRUEnever evaluated
FALSEnever evaluated
0-2473
959 forkfd = -1; // Child is dead, don't try to kill it anymore-
960-
961#if defined QPROCESS_DEBUG-
962 qDebug() << "QProcessPrivate::waitForDeadChild() dead with exitCode"-
963 << exitCode << ", crashed?" << crashed;-
964#endif-
965 return true;
executed 2473 times by 38 tests: return true;
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_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
  • ...
2473
966}-
967-
968bool QProcessPrivate::startDetached(const QString &program, const QStringList &arguments, const QString &workingDirectory, qint64 *pid)-
969{-
970 QByteArray encodedWorkingDirectory = QFile::encodeName(workingDirectory);-
971-
972 // To catch the startup of the child-
973 int startedPipe[2];-
974 if (qt_safe_pipe(startedPipe) != 0)
qt_safe_pipe(startedPipe) != 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QProcess
0-4
975 return false;
never executed: return false;
0
976 // To communicate the pid of the child-
977 int pidPipe[2];-
978 if (qt_safe_pipe(pidPipe) != 0) {
qt_safe_pipe(pidPipe) != 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QProcess
0-4
979 qt_safe_close(startedPipe[0]);-
980 qt_safe_close(startedPipe[1]);-
981 return false;
never executed: return false;
0
982 }-
983-
984 pid_t childPid = fork();-
985 if (childPid == 0) {
childPid == 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QProcess
0-4
986 struct sigaction noaction;-
987 memset(&noaction, 0, sizeof(noaction));-
988 noaction.sa_handler = SIG_IGN;-
989 ::sigaction(SIGPIPE, &noaction, 0);-
990-
991 ::setsid();-
992-
993 qt_safe_close(startedPipe[0]);-
994 qt_safe_close(pidPipe[0]);-
995-
996 pid_t doubleForkPid = fork();-
997 if (doubleForkPid == 0) {
doubleForkPid == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
998 qt_safe_close(pidPipe[1]);-
999-
1000 if (!encodedWorkingDirectory.isEmpty()) {
!encodedWorkin...tory.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
1001 if (QT_CHDIR(encodedWorkingDirectory.constData()) == -1)
::chdir(encode...tData()) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1002 qWarning("QProcessPrivate::startDetached: failed to chdir to %s", encodedWorkingDirectory.constData());
never executed: QMessageLogger(__FILE__, 1002, __PRETTY_FUNCTION__).warning("QProcessPrivate::startDetached: failed to chdir to %s", encodedWorkingDirectory.constData());
0
1003 }
never executed: end of block
0
1004-
1005 char **argv = new char *[arguments.size() + 2];-
1006 for (int i = 0; i < arguments.size(); ++i)
i < arguments.size()Description
TRUEnever evaluated
FALSEnever evaluated
0
1007 argv[i + 1] = ::strdup(QFile::encodeName(arguments.at(i)).constData());
never executed: argv[i + 1] = ::strdup(QFile::encodeName(arguments.at(i)).constData());
0
1008 argv[arguments.size() + 1] = 0;-
1009-
1010 if (!program.contains(QLatin1Char('/'))) {
!program.conta...tin1Char('/'))Description
TRUEnever evaluated
FALSEnever evaluated
0
1011 const QString path = QString::fromLocal8Bit(qgetenv("PATH"));-
1012 if (!path.isEmpty()) {
!path.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
1013 QStringList pathEntries = path.split(QLatin1Char(':'));-
1014 for (int k = 0; k < pathEntries.size(); ++k) {
k < pathEntries.size()Description
TRUEnever evaluated
FALSEnever evaluated
0
1015 QByteArray tmp = QFile::encodeName(pathEntries.at(k));-
1016 if (!tmp.endsWith('/')) tmp += '/';
never executed: tmp += '/';
!tmp.endsWith('/')Description
TRUEnever evaluated
FALSEnever evaluated
0
1017 tmp += QFile::encodeName(program);-
1018 argv[0] = tmp.data();-
1019 qt_safe_execv(argv[0], argv);-
1020 }
never executed: end of block
0
1021 }
never executed: end of block
0
1022 } else {
never executed: end of block
0
1023 QByteArray tmp = QFile::encodeName(program);-
1024 argv[0] = tmp.data();-
1025 qt_safe_execv(argv[0], argv);-
1026 }
never executed: end of block
0
1027-
1028 struct sigaction noaction;-
1029 memset(&noaction, 0, sizeof(noaction));-
1030 noaction.sa_handler = SIG_IGN;-
1031 ::sigaction(SIGPIPE, &noaction, 0);-
1032-
1033 // '\1' means execv failed-
1034 char c = '\1';-
1035 qt_safe_write(startedPipe[1], &c, 1);-
1036 qt_safe_close(startedPipe[1]);-
1037 ::_exit(1);-
1038 } else if (doubleForkPid == -1) {
never executed: end of block
doubleForkPid == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1039 struct sigaction noaction;-
1040 memset(&noaction, 0, sizeof(noaction));-
1041 noaction.sa_handler = SIG_IGN;-
1042 ::sigaction(SIGPIPE, &noaction, 0);-
1043-
1044 // '\2' means internal error-
1045 char c = '\2';-
1046 qt_safe_write(startedPipe[1], &c, 1);-
1047 }
never executed: end of block
0
1048-
1049 qt_safe_close(startedPipe[1]);-
1050 qt_safe_write(pidPipe[1], (const char *)&doubleForkPid, sizeof(pid_t));-
1051 if (QT_CHDIR("/") == -1)
::chdir("/") == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1052 qWarning("QProcessPrivate::startDetached: failed to chdir to /");
never executed: QMessageLogger(__FILE__, 1052, __PRETTY_FUNCTION__).warning("QProcessPrivate::startDetached: failed to chdir to /");
0
1053 ::_exit(1);-
1054 }
never executed: end of block
0
1055-
1056 qt_safe_close(startedPipe[1]);-
1057 qt_safe_close(pidPipe[1]);-
1058-
1059 if (childPid == -1) {
childPid == -1Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QProcess
0-4
1060 qt_safe_close(startedPipe[0]);-
1061 qt_safe_close(pidPipe[0]);-
1062 return false;
never executed: return false;
0
1063 }-
1064-
1065 char reply = '\0';-
1066 int startResult = qt_safe_read(startedPipe[0], &reply, 1);-
1067 int result;-
1068 qt_safe_close(startedPipe[0]);-
1069 qt_safe_waitpid(childPid, &result, 0);-
1070 bool success = (startResult != -1 && reply == '\0');
startResult != -1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEnever evaluated
reply == '\0'Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QProcess
0-4
1071 if (success && pid) {
successDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QProcess
pidDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QProcess
1-2
1072 pid_t actualPid = 0;-
1073 if (qt_safe_read(pidPipe[0], (char *)&actualPid, sizeof(pid_t)) == sizeof(pid_t)) {
qt_safe_read(p... sizeof(pid_t)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QProcess
FALSEnever evaluated
0-1
1074 *pid = actualPid;-
1075 } else {
executed 1 time by 1 test: end of block
Executed by:
  • tst_QProcess
1
1076 *pid = 0;-
1077 }
never executed: end of block
0
1078 }-
1079 qt_safe_close(pidPipe[0]);-
1080 return success;
executed 4 times by 1 test: return success;
Executed by:
  • tst_QProcess
4
1081}-
1082-
1083QT_END_NAMESPACE-
1084-
1085#endif // QT_NO_PROCESS-
Source codeSwitch to Preprocessed file

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