summaryrefslogtreecommitdiffstats
path: root/src/testlib/qbenchmarkvalgrind.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <[email protected]>2014-10-20 19:12:23 +0200
committerFrederik Gladhorn <[email protected]>2014-10-20 19:12:25 +0200
commit3361fcbc28be96262d22fd2b024c85fbcbc61462 (patch)
tree48976f337b3885971dc1976b9a27cec5e7dfa2ec /src/testlib/qbenchmarkvalgrind.cpp
parentdc612acdc6577594c8f61345cea2de549d7aae34 (diff)
parent5e342f6f041208d142d97202f61179d7163eb773 (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Diffstat (limited to 'src/testlib/qbenchmarkvalgrind.cpp')
-rw-r--r--src/testlib/qbenchmarkvalgrind.cpp24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/testlib/qbenchmarkvalgrind.cpp b/src/testlib/qbenchmarkvalgrind.cpp
index c4807536751..f107645ab52 100644
--- a/src/testlib/qbenchmarkvalgrind.cpp
+++ b/src/testlib/qbenchmarkvalgrind.cpp
@@ -45,33 +45,15 @@
QT_BEGIN_NAMESPACE
-// Returns \c true iff a sufficiently recent valgrind is available.
+// Returns \c true if valgrind is available.
bool QBenchmarkValgrindUtils::haveValgrind()
{
#ifdef NVALGRIND
return false;
#else
QProcess process;
- QStringList args;
- args << QLatin1String("--version");
- process.start(QLatin1String("valgrind"), args);
- if (!process.waitForFinished(-1))
- return false;
- const QByteArray out = process.readAllStandardOutput();
- QRegExp rx(QLatin1String("^valgrind-([0-9]+).([0-9]+).[0-9]+"));
- if (rx.indexIn(QLatin1String(out.data())) == -1)
- return false;
- bool ok;
- const int major = rx.cap(1).toInt(&ok);
- if (!ok)
- return false;
- const int minor = rx.cap(2).toInt(&ok);
- if (!ok)
- return false;
-// return (major > 3 || (major == 3 && minor >= 3)); // v >= 3.3 for --callgrind-out-file option
- Q_UNUSED(major);
- Q_UNUSED(minor);
- return true; // skip version restriction for now
+ process.start(QLatin1String("valgrind"), QStringList(QLatin1String("--version")));
+ return process.waitForStarted() && process.waitForFinished(-1);
#endif
}