Utils: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*

And instead of qgetenv.
Takes Qt Creator's setting at "Environment > System > Environment" into
account, which makes it easier on some platforms to set them (e.g.
macOS), can be configured differently in different settings paths, and
potentially can be changed at runtime (depending on usage).

Change-Id: I50e457bab2d3495e5c69676fe1a0257a5fea3e52
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Eike Ziller
2022-08-24 09:43:33 +02:00
parent 7801fda463
commit e77c90469b
5 changed files with 15 additions and 11 deletions

View File

@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "benchmarker.h"
#include "environment.h"
#include <QCoreApplication>
#include <QLoggingCategory>
@@ -48,7 +49,7 @@ void Benchmarker::report(const QString &testsuite,
void Benchmarker::report(const QLoggingCategory &cat, const QString &testsuite, const QString &testcase,
qint64 ms, const QString &tags)
{
static const QByteArray quitAfter = qgetenv("QTC_QUIT_AFTER_BENCHMARK");
static const QByteArray quitAfter = qtcEnvironmentVariable("QTC_QUIT_AFTER_BENCHMARK").toLatin1();
QString t = "unit=ms";
if (!tags.isEmpty())
t += "," + tags;