diff options
| author | Sona Kurazyan <[email protected]> | 2022-04-26 17:07:00 +0200 |
|---|---|---|
| committer | Marc Mutz <[email protected]> | 2022-05-02 20:06:20 +0000 |
| commit | 7baa06fe0c7fa1a1d20ae749915a6483621f204e (patch) | |
| tree | 4870b761bd66e7f61d37375f80917c7445692884 /src/testlib/qbenchmarkvalgrind.cpp | |
| parent | 34242f843ec41b63c706e4604ac3a65805d11107 (diff) | |
QtTestLib: replace QLatin1String uses with _L1/_s/QStringLiteral
Task-number: QTBUG-98434
Change-Id: Ie327fd4af1880002e5a1e09b43384f2b709625e7
Reviewed-by: Marc Mutz <[email protected]>
Reviewed-by: Edward Welbourne <[email protected]>
Diffstat (limited to 'src/testlib/qbenchmarkvalgrind.cpp')
| -rw-r--r-- | src/testlib/qbenchmarkvalgrind.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/testlib/qbenchmarkvalgrind.cpp b/src/testlib/qbenchmarkvalgrind.cpp index 29cbcd8e3c6..6068e56b89a 100644 --- a/src/testlib/qbenchmarkvalgrind.cpp +++ b/src/testlib/qbenchmarkvalgrind.cpp @@ -50,6 +50,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + // Returns \c true if valgrind is available. bool QBenchmarkValgrindUtils::haveValgrind() { @@ -57,7 +59,7 @@ bool QBenchmarkValgrindUtils::haveValgrind() return false; #else QProcess process; - process.start(QLatin1String("valgrind"), QStringList(QLatin1String("--version"))); + process.start(u"valgrind"_s, QStringList(u"--version"_s)); return process.waitForStarted() && process.waitForFinished(-1); #endif } @@ -89,7 +91,7 @@ qint64 QBenchmarkValgrindUtils::extractResult(const QString &fileName) qint64 val = -1; bool valSeen = false; - QRegularExpression rxValue(QLatin1String("^summary: (\\d+)")); + QRegularExpression rxValue(u"^summary: (\\d+)"_s); while (!file.atEnd()) { const QString line(QLatin1String(file.readLine())); QRegularExpressionMatch match = rxValue.match(line); @@ -169,22 +171,20 @@ QString QBenchmarkValgrindUtils::outFileBase(qint64 pid) bool QBenchmarkValgrindUtils::runCallgrindSubProcess(const QStringList &origAppArgs, int &exitCode) { const QString &execFile = origAppArgs.at(0); - QStringList args; - args << QLatin1String("--tool=callgrind") << QLatin1String("--instr-atstart=yes") - << QLatin1String("--quiet") - << execFile << QLatin1String("-callgrindchild"); + QStringList args{ u"--tool=callgrind"_s, u"--instr-atstart=yes"_s, + u"--quiet"_s, execFile, u"-callgrindchild"_s }; // pass on original arguments that make sense (e.g. avoid wasting time producing output // that will be ignored anyway) ... for (int i = 1; i < origAppArgs.size(); ++i) { const QString &arg = origAppArgs.at(i); - if (arg == QLatin1String("-callgrind")) + if (arg == "-callgrind"_L1) continue; args << arg; // ok to pass on } QProcess process; - process.start(QLatin1String("valgrind"), args); + process.start(u"valgrind"_s, args); process.waitForStarted(-1); QBenchmarkGlobalData::current->callgrindOutFileBase = QBenchmarkValgrindUtils::outFileBase(process.processId()); |
