forked from qt-creator/qt-creator
AutoTest: Make scan thread limit customizable
Allow users to specify the tread limit used when scanning for tests. By default we continue to use a fourth of the available logical CPUs. Task-number: QTCREATORBUG-29301 Change-Id: Ic92a4d0908093c0664aa1ba924e0c17dfd0082f9 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "autotestconstants.h"
|
||||
#include "autotesttr.h"
|
||||
#include "testsettings.h"
|
||||
#include "testtreemodel.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
@@ -360,7 +361,11 @@ void TestCodeParser::scanForTests(const QSet<FilePath> &filePaths,
|
||||
|
||||
using namespace Tasking;
|
||||
|
||||
QList<GroupItem> tasks{parallelLimit(std::max(QThread::idealThreadCount() / 4, 1))};
|
||||
int limit = TestSettings::instance()->scanThreadLimit();
|
||||
if (limit == 0)
|
||||
limit = std::max(QThread::idealThreadCount() / 4, 1);
|
||||
qCDebug(LOG) << "Using" << limit << "threads for scan.";
|
||||
QList<GroupItem> tasks{parallelLimit(limit)};
|
||||
for (const FilePath &file : filteredFiles) {
|
||||
const auto setup = [this, codeParsers, file](Async<TestParseResultPtr> &async) {
|
||||
async.setConcurrentCallData(parseFileForTests, codeParsers, file);
|
||||
|
||||
Reference in New Issue
Block a user