forked from qt-creator/qt-creator
AutoTest: tr()-Fixes
Do not use QObject::tr(). Change-Id: If92f36166f29defd3501410efeed8e6f68dc896d Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
committed by
Christian Stenger
parent
a320628245
commit
8d3e0a1017
@@ -123,7 +123,7 @@ static QString constructBenchmarkInformation(const QString &metric, double value
|
|||||||
metricsText = QLatin1String("instruction reads");
|
metricsText = QLatin1String("instruction reads");
|
||||||
else if (metric == QLatin1String("CPUCycles")) // -perf
|
else if (metric == QLatin1String("CPUCycles")) // -perf
|
||||||
metricsText = QLatin1String("CPU cycles");
|
metricsText = QLatin1String("CPU cycles");
|
||||||
return QObject::tr("%1 %2 per iteration (total: %3, iterations: %4)")
|
return QtTestOutputReader::tr("%1 %2 per iteration (total: %3, iterations: %4)")
|
||||||
.arg(formatResult(value))
|
.arg(formatResult(value))
|
||||||
.arg(metricsText)
|
.arg(metricsText)
|
||||||
.arg(formatResult(value * (double)iterations))
|
.arg(formatResult(value * (double)iterations))
|
||||||
|
@@ -99,7 +99,7 @@ TestRunner::TestRunner(QObject *parent) :
|
|||||||
connect(&m_futureWatcher, &QFutureWatcher<TestResultPtr>::canceled,
|
connect(&m_futureWatcher, &QFutureWatcher<TestResultPtr>::canceled,
|
||||||
this, [this]() { emit testResultReady(TestResultPtr(new FaultyTestResult(
|
this, [this]() { emit testResultReady(TestResultPtr(new FaultyTestResult(
|
||||||
Result::MessageFatal,
|
Result::MessageFatal,
|
||||||
QObject::tr("Test run canceled by user."))));
|
tr("Test run canceled by user."))));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ static void performTestRun(QFutureInterface<TestResultPtr> &futureInterface,
|
|||||||
testCaseCount += config->testCaseCount();
|
testCaseCount += config->testCaseCount();
|
||||||
} else {
|
} else {
|
||||||
futureInterface.reportResult(TestResultPtr(new FaultyTestResult(Result::MessageWarn,
|
futureInterface.reportResult(TestResultPtr(new FaultyTestResult(Result::MessageWarn,
|
||||||
QObject::tr("Project is null for \"%1\". Removing from test run.\n"
|
TestRunner::tr("Project is null for \"%1\". Removing from test run.\n"
|
||||||
"Check the test environment.").arg(config->displayName()))));
|
"Check the test environment.").arg(config->displayName()))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -164,7 +164,7 @@ static void performTestRun(QFutureInterface<TestResultPtr> &futureInterface,
|
|||||||
QString commandFilePath = executableFilePath(testConfiguration->targetFile(), environment);
|
QString commandFilePath = executableFilePath(testConfiguration->targetFile(), environment);
|
||||||
if (commandFilePath.isEmpty()) {
|
if (commandFilePath.isEmpty()) {
|
||||||
futureInterface.reportResult(TestResultPtr(new FaultyTestResult(Result::MessageFatal,
|
futureInterface.reportResult(TestResultPtr(new FaultyTestResult(Result::MessageFatal,
|
||||||
QObject::tr("Could not find command \"%1\". (%2)")
|
TestRunner::tr("Could not find command \"%1\". (%2)")
|
||||||
.arg(testConfiguration->targetFile())
|
.arg(testConfiguration->targetFile())
|
||||||
.arg(testConfiguration->displayName()))));
|
.arg(testConfiguration->displayName()))));
|
||||||
continue;
|
continue;
|
||||||
@@ -231,7 +231,7 @@ static void performTestRun(QFutureInterface<TestResultPtr> &futureInterface,
|
|||||||
testProcess.waitForFinished();
|
testProcess.waitForFinished();
|
||||||
}
|
}
|
||||||
futureInterface.reportResult(TestResultPtr(
|
futureInterface.reportResult(TestResultPtr(
|
||||||
new FaultyTestResult(Result::MessageFatal, QObject::tr(
|
new FaultyTestResult(Result::MessageFatal, TestRunner::tr(
|
||||||
"Test case canceled due to timeout. \nMaybe raise the timeout?"))));
|
"Test case canceled due to timeout. \nMaybe raise the timeout?"))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -68,14 +68,14 @@ QVariant TestTreeItem::data(int /*column*/, int role) const
|
|||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
if (m_type == Root && childCount() == 0)
|
if (m_type == Root && childCount() == 0)
|
||||||
return QString(m_name + QObject::tr(" (none)"));
|
return QString(m_name + QCoreApplication::translate("TestTreeItem", " (none)"));
|
||||||
else if (m_name.isEmpty())
|
else if (m_name.isEmpty())
|
||||||
return QObject::tr(Constants::UNNAMED_QUICKTESTS);
|
return QCoreApplication::translate("TestTreeItem", Constants::UNNAMED_QUICKTESTS);
|
||||||
else
|
else
|
||||||
return m_name;
|
return m_name;
|
||||||
case Qt::ToolTipRole:
|
case Qt::ToolTipRole:
|
||||||
if (m_type == TestCase && m_name.isEmpty()) {
|
if (m_type == TestCase && m_name.isEmpty()) {
|
||||||
return QObject::tr("<p>Give all test cases a name to ensure correct behavior "
|
return QCoreApplication::translate("TestTreeItem","<p>Give all test cases a name to ensure correct behavior "
|
||||||
"when running test cases and to be able to select them.</p>");
|
"when running test cases and to be able to select them.</p>");
|
||||||
}
|
}
|
||||||
return m_filePath;
|
return m_filePath;
|
||||||
@@ -454,7 +454,8 @@ TestTreeItem *GoogleTestTreeItem::findChildByNameStateAndFile(const QString &nam
|
|||||||
|
|
||||||
QString GoogleTestTreeItem::nameSuffix() const
|
QString GoogleTestTreeItem::nameSuffix() const
|
||||||
{
|
{
|
||||||
static QString markups[] = { QObject::tr("parameterized"), QObject::tr("typed") };
|
static QString markups[] = { QCoreApplication::translate("GoogleTestTreeItem", "parameterized"),
|
||||||
|
QCoreApplication::translate("GoogleTestTreeItem", "typed") };
|
||||||
QString suffix;
|
QString suffix;
|
||||||
if (m_state & Parameterized)
|
if (m_state & Parameterized)
|
||||||
suffix = QLatin1String(" [") + markups[0];
|
suffix = QLatin1String(" [") + markups[0];
|
||||||
|
Reference in New Issue
Block a user