OpenCoverage

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

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