diff options
Diffstat (limited to 'tests/benchmarker')
-rw-r--r-- | tests/benchmarker/benchmarker.cpp | 4 | ||||
-rw-r--r-- | tests/benchmarker/benchmarker.h | 5 | ||||
-rw-r--r-- | tests/benchmarker/runsupport.h | 2 | ||||
-rw-r--r-- | tests/benchmarker/valgrindrunner.cpp | 24 | ||||
-rw-r--r-- | tests/benchmarker/valgrindrunner.h | 7 |
5 files changed, 19 insertions, 23 deletions
diff --git a/tests/benchmarker/benchmarker.cpp b/tests/benchmarker/benchmarker.cpp index 2cc442a72..3c5fcde4e 100644 --- a/tests/benchmarker/benchmarker.cpp +++ b/tests/benchmarker/benchmarker.cpp @@ -77,8 +77,8 @@ void Benchmarker::benchmark() m_baseOutputDir.path() + "/benchmark-data." + m_oldCommit); ValgrindRunner newDataRetriever(m_activities, m_testProject, newQbsBuildDir, m_baseOutputDir.path() + "/benchmark-data." + m_newCommit); - QFuture<void> oldFuture = QtConcurrent::run(&oldDataRetriever, &ValgrindRunner::run); - QFuture<void> newFuture = QtConcurrent::run(&newDataRetriever, &ValgrindRunner::run); + QFuture<void> oldFuture = QtConcurrent::run([&oldDataRetriever]{ oldDataRetriever.run(); }); + QFuture<void> newFuture = QtConcurrent::run([&newDataRetriever]{ newDataRetriever.run(); }); oldFuture.waitForFinished(); const auto oldValgrindResults = oldDataRetriever.results(); for (const ValgrindResult &valgrindResult : oldValgrindResults) { diff --git a/tests/benchmarker/benchmarker.h b/tests/benchmarker/benchmarker.h index 6313e8094..8c94e7f74 100644 --- a/tests/benchmarker/benchmarker.h +++ b/tests/benchmarker/benchmarker.h @@ -32,12 +32,9 @@ #include <QtCore/qhash.h> #include <QtCore/qstring.h> +#include <QtCore/qstringlist.h> #include <QtCore/qtemporarydir.h> -QT_BEGIN_NAMESPACE -class QStringList; -QT_END_NAMESPACE - namespace qbsBenchmarker { class BenchmarkResult diff --git a/tests/benchmarker/runsupport.h b/tests/benchmarker/runsupport.h index 6ee831007..39f485a02 100644 --- a/tests/benchmarker/runsupport.h +++ b/tests/benchmarker/runsupport.h @@ -30,10 +30,10 @@ #include <QtCore/qglobal.h> #include <QtCore/qstring.h> +#include <QtCore/qstringlist.h> QT_BEGIN_NAMESPACE class QByteArray; -class QStringList; QT_END_NAMESPACE namespace qbsBenchmarker { diff --git a/tests/benchmarker/valgrindrunner.cpp b/tests/benchmarker/valgrindrunner.cpp index 174781318..72745dc16 100644 --- a/tests/benchmarker/valgrindrunner.cpp +++ b/tests/benchmarker/valgrindrunner.cpp @@ -59,11 +59,11 @@ void ValgrindRunner::run() { std::deque<QFuture<void>> futures; if (m_activities & ActivityResolving) - futures.push_back(QtConcurrent::run(this, &ValgrindRunner::traceResolving)); + futures.push_back(QtConcurrent::run([this]{ traceResolving(); })); if (m_activities & ActivityRuleExecution) - futures.push_back(QtConcurrent::run(this, &ValgrindRunner::traceRuleExecution)); + futures.push_back(QtConcurrent::run([this]{ traceRuleExecution(); })); if (m_activities & ActivityNullBuild) - futures.push_back(QtConcurrent::run(this, &ValgrindRunner::traceNullBuild)); + futures.push_back(QtConcurrent::run([this]{ traceNullBuild(); })); while (!futures.empty()) { futures.front().waitForFinished(); futures.pop_front(); @@ -100,12 +100,11 @@ void ValgrindRunner::traceActivity(Activity activity, const QString &buildDirCal { QString activityString; QString qbsCommand; - bool dryRun; + bool dryRun = false; switch (activity) { case ActivityResolving: activityString = "resolving"; qbsCommand = "resolve"; - dryRun = false; break; case ActivityRuleExecution: activityString = "rule-execution"; @@ -115,16 +114,21 @@ void ValgrindRunner::traceActivity(Activity activity, const QString &buildDirCal case ActivityNullBuild: activityString = "null-build"; qbsCommand = "build"; - dryRun = false; break; } const QString outFileCallgrind = m_baseOutputDir + "/outfile." + activityString + ".callgrind"; const QString outFileMassif = m_baseOutputDir + "/outfile." + activityString + ".massif"; - QFuture<qint64> callGrindFuture = QtConcurrent::run(this, &ValgrindRunner::runCallgrind, - qbsCommand, buildDirCallgrind, dryRun, outFileCallgrind); - QFuture<qint64> massifFuture = QtConcurrent::run(this, &ValgrindRunner::runMassif, qbsCommand, - buildDirMassif, dryRun, outFileMassif); + QFuture<qint64> callGrindFuture = QtConcurrent::run( + [this, qbsCommand, buildDirCallgrind, dryRun, outFileCallgrind] + { + return runCallgrind(qbsCommand, buildDirCallgrind, dryRun, outFileCallgrind); + }); + QFuture<qint64> massifFuture = QtConcurrent::run( + [this, qbsCommand, buildDirMassif, dryRun, outFileMassif] + { + return runMassif(qbsCommand, buildDirMassif, dryRun, outFileMassif); + }); callGrindFuture.waitForFinished(); massifFuture.waitForFinished(); addToResults(ValgrindResult(activity, callGrindFuture.result(), massifFuture.result())); diff --git a/tests/benchmarker/valgrindrunner.h b/tests/benchmarker/valgrindrunner.h index 378723868..c83fea468 100644 --- a/tests/benchmarker/valgrindrunner.h +++ b/tests/benchmarker/valgrindrunner.h @@ -30,15 +30,10 @@ #include "activities.h" -#include <QtCore/qlist.h> -#include <QtCore/qstring.h> +#include <QtCore/qstringlist.h> #include <mutex> -QT_BEGIN_NAMESPACE -class QStringList; -QT_END_NAMESPACE - namespace qbsBenchmarker { class ValgrindResult |