summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qprocess
Commit message (Collapse)AuthorAgeFilesLines
* Add copyright and licensing to .bat files missing themLucie Gérard13 days2-2/+6
| | | | | | Task-number: QTBUG-124453 Change-Id: I8bd48ab5d5b18197ef5bf9a46edf49da86374bee Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QProcess: fix startCommand() with whitespace-only stringsThiago Macieira2024-04-191-0/+20
| | | | | | | | | | | | | | We'd end up trying to takeFirst() from an empty QStringList. [ChangeLog][QtCore][QProcess] Fixed a bug that would cause startCommand() to crash if passed a string that was empty or contained only whitespace characters. Fixes: QTBUG-124512 Pick-to: 6.5 6.6 6.7 Change-Id: I455fe22ef4ad4b2f9b01fffd17c7689095c39272 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Tests: make some QFile::open calls failGiuseppe D'Angelo2024-04-131-1/+2
| | | | | | | | | | In some cases calls to QFile::open are made outside of a testfunction (so we can't use QVERIFY), or even in standalone executables that are executed by tests. Make them fail "visibly". Change-Id: Iec4d56f6d874be16aa2e9ad6974eeec2a98caa3f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProcess/Unix: fix close() on invalid file descriptorThiago Macieira2024-03-121-5/+20
| | | | | | | | | | | | | | | | Commit 90bc0ad41f9937f9cba801b3166635f6f55e0678 ("QProcess/Unix: add failChildProcessModifier()") added this line that set childStartedPipe so that the failChildProcess() callback had something to write to. But we left it set on exit from QProcessPrivate::startDetached(), which caused the QProcess destructor to try and close it. Noticed when debugging the issue for QTBUG-123083. Pick-to: 6.7 6.7.0 Task-number: QTBUG-123083 Change-Id: I6818d78a57394e37857bfffd17bbc41c8400270f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Change license for tests filesLucie Gérard2024-02-0426-26/+26
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* QProcess: align treatment of early start errorsThiago Macieira2024-01-221-3/+87
| | | | | | | | | | | | | | | | There are a couple of possible runtime errors that could happen before the state was changed to QProcess::Starting. This aligns the Unix code with Windows, which has the state transition at the top, and with the documentation which says we will enter QProcess::Starting state. Complements commit 956b2495285251e4840ec32885ffa2cfbb7bd79c, repeating what it did for Unix (removing the overwriting of the error message that openChannel() sets) on Windows. We also need to ensure cleanup() is always called. Pick-to: 6.6 6.7 Change-Id: I76ffba14ece04f24b43efffd17aafdd47f908bf1 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* QProcess: use enum types in tests instead of plain intAhmad Samir2024-01-221-28/+27
| | | | | | Pick-to: 6.7 Change-Id: Ibba85d28c2a5329f9224ffdc893f2dab8e672ee9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix some -Wunused-* warnings on MinGWMarc Mutz2024-01-101-0/+1
| | | | | | | | | | | | Found while inspecting a recent MingWG log file from the CI. Amends a2551c45d496c23045eb8451e080e75b2f8b42c1. Amends f992402f15fd117bb5ccf9a484bf31fd4f4967e2. Pick-to: 6.7 6.6 Change-Id: Icf56ddc19ac7b40718ec3f429d14cbcb1a2e164f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Tests: remove blacklisted CIs no longer availableChristian Ehrlicher2023-12-061-6/+0
| | | | | | | | | | | | | | | | Remove the following CIs from BLACKLIST files as they are no longer used: - msvc-2015 - msvc-2017 - windows-7sp1 - opensuse-42.3 - ubuntu 16.04/18.04/20.04 - rhel 6.6/7.4/7.6 - redhatenterpriselinuxworkstation-6.6 Change-Id: Ief9550e3455a1ed211d978933262c8d5557b0fec Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* tst_QProcess::startStopStartStopBuffers: depend less on OS configurationThiago Macieira2023-10-181-8/+13
| | | | | | | | | | | | | | | | | The comment in this function made it clear that it really depended on the size of the pipe buffer in the OS. I don't see a way to make a pipe default to a different size on Linux -- it always defaults to PIPE_DEF_BUFFERS (16) and that value is only increased as a result of fcntl(F_SETPIPE_SZ), which we don't do. But we can be defensive and simply write until the OS can't take any more data. Drive-by update the comment on Windows to be clear that bytesToWrite() does work, but only while the child process is still running. Pick-to: 6.6 Task-number: QTBUG-80953 Change-Id: I9d43e5b91eb142d6945cfffd17866d22a4127e5e Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QProcess: remove a XFAIL for QNXGiuseppe D'Angelo2023-09-081-4/+0
| | | | | | | | | | | 91dcc76fc1 might have fixed the underlying issue, so we no longer need the XFAIL codepath at all. Fixes: QTBUG-114720 Change-Id: I67ccbed67a0536b679c50c26eb0b3e51c93dceeb Pick-to: 6.6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QProcess/Unix: add a simple way to reset the UID and GID for the childThiago Macieira2023-07-082-0/+14
| | | | | | | | | | | | | | | This is done as one of the last steps inside QProcess itself, so the child modifier and all other tasks still run with the parent process' permissions. On Linux, setting the UID to non-zero will also automatically clear the effective capabilities(7) set. This feature is only useful for setuid or setgid applications, so this commit updates the QCoreApplication::setSetuidAllowed() documentation to mention the QProcess flag. Change-Id: I3e3bfef633af4130a03afffd175e940c0668d244 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QProcess/Unix: add a few, basic session & terminal management flagsThiago Macieira2023-07-082-0/+60
| | | | | | | | | | | | Doing setsid() and disconnecting from the controlling terminal are, in addition to resetting the standard file descriptors to /dev/null, a common task that daemons do. These options allow a QProcess to force a child to be a daemon. QProcess ensures that the operations are done in the correct order. Change-Id: I3e3bfef633af4130a03afffd175e9451d2716d7a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QProcess on QNX: only expect failure if there is oneVolker Hilsheimer2023-07-091-2/+4
| | | | | | | | | | | The QProcessunixProcessParameters sometimes fails in CI with an XPASS. Unclear under what conditions QNX behaves correctly, so accept that it is unpredictable and only expect a failure when a failure is imminent. Amends f9c87cfd44bcf4b90cb45354252ef19f647b0469. Change-Id: Icf70861343747e6323c7953a2462b7bbc46549b3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Make corelib tests standalone projectsAlexandru Croitor2023-07-051-0/+6
| | | | | | | | | | | | | | | | | | Add the boilerplate standalone test prelude to each test, so that they can be opened with an IDE without the qt-cmake-standalone-test script, but directly with qt-cmake or cmake. Boilerplate was added using the following scripts: https://git.qt.io/alcroito/cmake_refactor Manual adjustments were made where the code was inserted in the wrong location. Task-number: QTBUG-93020 Change-Id: I28b6d3815c5f43d2c33ea65764f6f3f8f129eaf3 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProcess/Unix: block all Unix signals between vfork() and exec()Thiago Macieira2023-06-281-2/+78
| | | | | | | | | | | | | | | | | | | This is similar to and extends the prevention of thread cancellation introduced by commit ba05af82d3d8b7cbc6e22f93cbf1e3d1575afefe. This prevents the situation in which a signal gets delivered (usually because of a crash) and the parent process' handler is run, doing things it shouldn't between vfork() and execve(). Most C libraries (all that I've investigated) unblock SIGABRT on abort(), so this doesn't affect them. Likewise, on most OSes, crashes ignore the signal block and terminate the application -- Darwin appears to be an exception, but vfork() is not enabled there. Both situations are tested by terminateInChildProcessModifier(). Task-number: QTBUG-113822 Change-Id: Ib5ce7a497e034ebabb2cfffd17628ca33969b7af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QProcess/Unix: fix setting SIGPIPE to SIG_IGN where SIG_DFL was intendedThiago Macieira2023-06-211-0/+4
| | | | | | | | | | | And take the opportunity to clarify what the QtVforkSafe namespace is doing. Amends commit e71c226d6f188abd811b28d3cb7529343f52d61f. Pick-to: 6.6 Change-Id: I443cf0c8a76243eead33fffd1767f3fa390a7cdd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QProcess: add testUnixProcessParameters as a dep. for tst_qprocessAhmad Samir2023-06-181-0/+4
| | | | | | | So that building only tst_qprocess also builds the required test app. Change-Id: I19a92f9dd2f4de08302d09cad0caf55c285a6dae Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProcess/Unix: capture the child process modifier exception's what()Thiago Macieira2023-06-091-1/+9
| | | | | | Change-Id: I5f7f427ded124479baa6fffd175ffb017b6cd13c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QProcess/Unix: add failChildProcessModifier()Thiago Macieira2023-06-091-15/+112
| | | | | | | | | | | | | | | QProcess detects other types of failures from inside the modifier as successful starts, because the childStartedPipe gets closed without an error condition getting written. The new method allows a reporting as a proper failure-to-start. Added tests for both cases. [ChangeLog][QtCore][QProcess] Added failChildProcessModifier(). Change-Id: Icfe44ecf285a480fafe4fffd174da2b10306d3c2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProcess/Unix: update the close-file-descriptors feature with a minimumThiago Macieira2023-06-092-4/+59
| | | | | | | | | | | | | | | | | | | | So that one can pass a few extra file descriptors to the child while still closing all the rest. strace -f of this test showed on Linux: [pid 117952] dup3(4, 0, 0) = 0 [pid 117952] dup3(9, 1, 0) = 1 [pid 117952] dup3(11, 2, 0) = 2 [pid 117952] close(12) = 0 [pid 117952] dup2(100, 3) = 3 [pid 117952] close_range(4, 2147483647, 0) = 0 [pid 117952] execve("testUnixProcessParameters/testUnixProcessParameters", ["testUnixProcessParameters/testUn"..., "file-descriptors2", "3", "100"], 0x561793dc87d0 /* 120 vars */ <unfinished ...> Pick-to: 6.6 Change-Id: I3e3bfef633af4130a03afffd175e984bf50b558d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProcess/Unix: reset the signal block if ResetSignalHandlers requestedThiago Macieira2023-06-092-6/+28
| | | | | | | | | | | This amends commit f9c87cfd44bcf4b90cb45354252ef19f647b0469 to reset the signal block mask too, not just the signal handlers. For this, SIGPIPE is not treated specially. Pick-to: 6.6 Change-Id: Ib5ce7a497e034ebabb2cfffd17627289614bf315 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_QProcess: move the crasher code to a headerThiago Macieira2023-06-072-42/+63
| | | | | | | | | | | | So I can use it in tst_QProcess itself. This also modernizes it a bit by using __builtin_trap() where available. On x86-64, this expands to the ud2 instruction. Pick-to: 6.6 Change-Id: Ib5ce7a497e034ebabb2cfffd176288433378731b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_QProcess: put the tests in the right orderThiago Macieira2023-06-031-75/+73
| | | | | | | | | They were in the right order before rebasing multiple times. kdiff3 is currently broken, so I don't know what happened. Change-Id: Ib5ce7a497e034ebabb2cfffd17626fcf46c541fd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QProcess/Linux: add a flag to re-enable the vfork()-like semanticsThiago Macieira2023-05-221-2/+16
| | | | | | | | | | | | | | | | | | Commit 29b2fe40dc778ec73da7e5643fcfd8979d8ecebc disabled it by reverting commit d6bf71123d3ef073f25610345cb5dc920e4fb783. We now add the promised flag to opt-in. The flag is added to all Unix systems, but it really only applies to Linux right now. No ChangeLog because the whole UnixProcessParameters structure is new and has its own changelog. Task-number: QTBUG-104493 Task-number: QTBUG-111243 Task-number: QTBUG-111964 Change-Id: Icfe44ecf285a480fafe4fffd174d4effd3382495 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QProcess/Unix: add setUnixProcessParameters()Thiago Macieira2023-05-224-0/+185
| | | | | | | | | | | | | | | This commit adds those three flags that are either frequent enough or difficult to do: close all file descriptors above stderr and reset the signal handlers. Setting SIGPIPE to be ignored isn't critical, but is required when the ResetSignalHandlers flag is used, as this is run after the user child process modifier. [ChangeLog][QtCore][QProcess] Added setUnixProcessParameters() function that can be used to modify certain settings of the child process, without the need to provide a callback using setChildProcessModifier(). Change-Id: Icfe44ecf285a480fafe4fffd174d0d1d63840403 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QProcess/Unix: enable setChildProcessModifier for startDetachedThiago Macieira2023-05-151-8/+21
| | | | | | | | | | | | | | Do this by making the actual child-execution code common between startProcess() and startDetached(). It does mean we've moved the chdir() operation from the child to the grandchild process, though. [ChangeLog][QtCore][QProcess] The modifier function set with setChildProcessModifier() will now also be executed when the process is started with startDetached(). Change-Id: Icfe44ecf285a480fafe4fffd174d9aa57dd7dfff Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QProcess/Unix: improve the error message if the child modifier throwsThiago Macieira2023-05-151-2/+2
| | | | | | | | Functionality added for 6.5, but after translatable string freeze. Change-Id: Icfe44ecf285a480fafe4fffd174d984c5349e0cb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QProcess/Unix: protect against stack unwinding in the child process stubThiago Macieira2023-05-151-0/+29
| | | | | | | | | | | | | | | | | | | | | | There are two types of stack unwinding that can happen on Unix systems: C++ exceptions and PThread cancellations (on some systems, like Linux, PThread cancellations can be caught in catch(...) statements). We call a variety of PThread cancellation functions from inside the child stub, like close(). To avoid problems, we disable PThread cancellations completely before fork() or vfork(). The C++ exception case is simpler, because we can be sure of catching them with the catch (...) statement and simply transform them into an error message. This is also testable, which the PThread cancellation isn't. The error message isn't ideal because we're string-frozen. I'll improve it for 6.6. Pick-to: 6.5 Change-Id: Icfe44ecf285a480fafe4fffd174d97a475c93ff1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_QProcess: move setChildProcessModifier test to a Q_OS_UNIX sectionThiago Macieira2023-05-151-39/+38
| | | | | | | | | | There's no need to say it's getting skipped on Windows. moc *can* parse the #ifdefs these days. Pick-to: 6.5 Change-Id: Icfe44ecf285a480fafe4fffd174d95c709ff6a74 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* tst_QProcess: don't link non-Qt helpers to QtCoreThiago Macieira2023-04-2517-0/+19
| | | | | Change-Id: Icfe44ecf285a480fafe4fffd174d481f5e548c7b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Corelib: s/Q_OS_MAC/Q_OS_DARWIN/wg except for doc and definitionEdward Welbourne2023-03-201-1/+1
| | | | | | | | | | I got tired of being told off by the inanity 'bot for faithfully reflecting existing #if-ery in new #if-ery. Retain only the documentation and definition of the deprecated define. Change-Id: I47f47b76bd239a360f27ae5afe593dfad8746538 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use qt_internal_add_executable in auto testsAmir Masoud Abdol2023-03-1417-19/+94
| | | | | | | | | | When possible, I replaced add_executable with qt_internal_add_executable. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I643d2e27f0d880fe9b6cec7af790e4c99227fb0c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QThread: add sleep(std::chrono::nanoseconds) overloadAhmad Samir2023-03-132-2/+2
| | | | | | | | | | | | | | All the other overloads are implemented using the new one. Windows change relies on the pre-check in the code review making sure it compiles. [ChangeLog][QtCore][QThread] Added sleep(std::chrono::nanoseconds) overload. Task-number: QTBUG-110059 Change-Id: I9a4f4bf09041788ec9275093b6b8d0386521e286 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tests: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-175-11/+0
| | | | | | | Pick-to: 6.5 Change-Id: I8d106554bb86ac1ec9bb7a4083de4c376bcbab1d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Skip QProcess tests when run under ASanVille Voutilainen2022-12-161-0/+3
| | | | | | | | | | These tests exhibit weird crashes when run under ASan, but sometimes they fail sometimes they don't. Pending more insight, just skip this test under that configuration. Fixes: QTBUG-109329 Change-Id: I49d940de419f7166aab0da0b8c2b44297c4b6d74 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-032-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Autotest/Unix: request zero-sized core dumps for crashing codeThiago Macieira2022-10-141-0/+16
| | | | | | | | | | | | | Unix systems have got crash loggers in the past 15-20 years, notably macOS and Linux (abrtd, systemd-coredumpd, etc.). By setting the core dump limit to zero, those tools should be mostly inhibited from running and thus not interfere with the parent process' timeouts. Even for systems without core dump loggers, disabling the writing of a core dump to the filesystem should also help. Pick-to: 6.4 Change-Id: I12a088d1ae424825abd3fffd171d112d0671effe Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_qprocess: remove unused loop counterJohannes Kauffmann2022-09-201-2/+0
| | | | | Change-Id: I1eece5a676cfa02fff27be01f25b07ddd82c40d6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-2324-24/+24
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-0324-0/+72
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-283-3/+3
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QProcess: skip processesInMultipleThreads test on emulatorsVolker Hilsheimer2022-07-132-0/+6
| | | | | | | | | | The test has timed out when run on ARM in qemu. We start more threads than the ideal count, which is likely too much for the emulator when not running the native architecture. Pick-to: 6.4 Change-Id: I42e11945070646551e77c10618df762a4bffc8ba Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use SPDX license identifiersLucie Gérard2022-05-1624-650/+50
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Ensure that readAllStandardError() doesn't crash on assertJarek Kobus2022-04-091-0/+10
| | | | | | | | | | | Ensure that it's safe to call readAllStandardError() when process channel mode is set to MergedChannels. Pick-to: 6.3 6.3.0 Task-number: QTBUG-102177 Task-number: QTCREATORBUG-27196 Change-Id: I01073255d9347dee4654d602802a12d341372b73 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProcess/Unix: ensure we don't accidentally execute something from CWDThiago Macieira2022-02-091-1/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unless "." (or the empty string) is in $PATH, we're not supposed to find executables in the current directory. This is how the Unix shells behave and we match their behavior. It's also the behavior Qt had prior to 5.9 (commit 28666d167aa8e602c0bea25ebc4d51b55005db13). On Windows, searching the current directory is the norm, so we keep that behavior. This commit does not add an explicit check for an empty return from QStandardPaths::findExecutable(). Instead, we allow that empty string to go all the way to execve(2), which will fail with ENOENT. We could catch it early, before fork(2), but why add code for the error case? See https://kde.org/info/security/advisory-20220131-1.txt [ChangeLog][Important Behavior Changes] When passed a simple program name with no slashes, QProcess on Unix systems will now only search the current directory if "." is one of the entries in the PATH environment variable. This bug fix restores the behavior QProcess had before Qt 5.9. If launching an executable in the directory set by setWorkingDirectory() or inherited from the parent is intended, pass a program name starting with "./". For more information and best practices about finding an executable, see QProcess' documentation. Pick-to: 5.15 6.2 6.3 Change-Id: I54f205f6b7314351b078fffd16cf7013c97ee9fb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QNX: Cannot handle threads in given timePasi Petäjäjärvi2021-12-121-0/+4
| | | | | | | | Large amount of threads is unstable and do not finish in given time Pick-to: 6.2 Change-Id: I0ce4c8cd278d6611c9e9da7326048279ccc458fd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert "QProcess: do not emit aboutToClose() twice"Alex Trotsenko2021-09-241-2/+0
| | | | | | | | | | This reverts commit efb90f6e7ed3e8d4f7b6c0fb96012cb3a9a9d037. Reason for revert: behavior change for signal listeners Change-Id: Ibe3c5d496cd61a9fccab17a10cc9fda8334fc9d4 Reviewed-by: Björn Schäpers <qt-codereview@hazardy.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QProcess: do not emit aboutToClose() twiceAlex Trotsenko2021-09-191-0/+2
| | | | | | | | | This signal is emitted by the QIODevice itself, so we don't have to emit it from QProcess::close(). Pick-to: 6.1 6.2 Change-Id: I9165b3eebadc17a66cc834d5ef54441d13f23d7d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>