Autotest: edit UI text and messages

Fix capitalization, punctuation, and grammar
issues.

Change-Id: Ie5044a1a3445ea078fe52ae20b1b4eec747e3de4
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
Leena Miettinen
2015-03-30 13:56:50 +02:00
committed by Riitta-Leena Miettinen
parent dbf11d4520
commit ae7b3e8404
6 changed files with 34 additions and 35 deletions

View File

@@ -196,13 +196,13 @@ void TestNavigationWidget::onParsingFinished()
void TestNavigationWidget::initializeFilterMenu() void TestNavigationWidget::initializeFilterMenu()
{ {
QAction *action = new QAction(m_filterMenu); QAction *action = new QAction(m_filterMenu);
action->setText(tr("Show init and cleanup functions")); action->setText(tr("Show Init and Cleanup Functions"));
action->setCheckable(true); action->setCheckable(true);
action->setChecked(false); action->setChecked(false);
action->setData(TestTreeSortFilterModel::ShowInitAndCleanup); action->setData(TestTreeSortFilterModel::ShowInitAndCleanup);
m_filterMenu->addAction(action); m_filterMenu->addAction(action);
action = new QAction(m_filterMenu); action = new QAction(m_filterMenu);
action->setText(tr("Show data functions")); action->setText(tr("Show Data Functions"));
action->setCheckable(true); action->setCheckable(true);
action->setChecked(false); action->setChecked(false);
action->setData(TestTreeSortFilterModel::ShowTestData); action->setData(TestTreeSortFilterModel::ShowTestData);

View File

@@ -324,7 +324,7 @@ void TestResultsPane::initializeFilterMenu()
void TestResultsPane::updateSummaryLabel() void TestResultsPane::updateSummaryLabel()
{ {
QString labelText = QString::fromLatin1("<p><b>Test Summary:</b>&nbsp;&nbsp; %1 %2, %3 %4") QString labelText = QString::fromLatin1("<p><b>Test summary:</b>&nbsp;&nbsp; %1 %2, %3 %4")
.arg(QString::number(m_model->resultTypeCount(Result::PASS)), tr("passes"), .arg(QString::number(m_model->resultTypeCount(Result::PASS)), tr("passes"),
QString::number(m_model->resultTypeCount(Result::FAIL)), tr("fails")); QString::number(m_model->resultTypeCount(Result::FAIL)), tr("fails"));
int count = m_model->resultTypeCount(Result::UNEXPECTED_PASS); int count = m_model->resultTypeCount(Result::UNEXPECTED_PASS);

View File

@@ -139,7 +139,7 @@ void performTestRun(QFutureInterface<void> &futureInterface,
QString commandFilePath = executableFilePath(testConfiguration->targetFile(), environment); QString commandFilePath = executableFilePath(testConfiguration->targetFile(), environment);
if (commandFilePath.isEmpty()) { if (commandFilePath.isEmpty()) {
emitTestResultCreated(FaultyTestResult(Result::MESSAGE_FATAL, emitTestResultCreated(FaultyTestResult(Result::MESSAGE_FATAL,
QObject::tr("*** Could not find command '%1' ***").arg(testConfiguration->targetFile()))); QObject::tr("Could not find command \"%1\".").arg(testConfiguration->targetFile())));
continue; continue;
} }
@@ -166,7 +166,7 @@ void performTestRun(QFutureInterface<void> &futureInterface,
testProcess.kill(); testProcess.kill();
testProcess.waitForFinished(); testProcess.waitForFinished();
emitTestResultCreated(FaultyTestResult(Result::MESSAGE_FATAL, emitTestResultCreated(FaultyTestResult(Result::MESSAGE_FATAL,
QObject::tr("*** Test Run canceled by user ***"))); QObject::tr("Test run canceled by user.")));
} }
qApp->processEvents(); qApp->processEvents();
} }
@@ -177,7 +177,7 @@ void performTestRun(QFutureInterface<void> &futureInterface,
testProcess.kill(); testProcess.kill();
testProcess.waitForFinished(); testProcess.waitForFinished();
emitTestResultCreated(FaultyTestResult(Result::MESSAGE_FATAL, QObject::tr( emitTestResultCreated(FaultyTestResult(Result::MESSAGE_FATAL, QObject::tr(
"*** Test Case canceled due to timeout ***\nMaybe raise the timeout?"))); "Test case canceled due to timeout. \nMaybe raise the timeout?")));
} }
} }
} }
@@ -200,13 +200,13 @@ void TestRunner::runTests()
if (!config->project()) { if (!config->project()) {
toBeRemoved.append(config); toBeRemoved.append(config);
TestResultsPane::instance()->addTestResult(FaultyTestResult(Result::MESSAGE_WARN, TestResultsPane::instance()->addTestResult(FaultyTestResult(Result::MESSAGE_WARN,
tr("*** Project is null for '%1' - removing from Test Run ***\n" tr("Project is null for \"%1\". Removing from test run.\n"
"This might be the case for a faulty environment or similar." "Check the test environment."
).arg(config->displayName()))); ).arg(config->displayName())));
} }
if (displayRunConfigWarnings && config->guessedConfiguration()) { if (displayRunConfigWarnings && config->guessedConfiguration()) {
TestResultsPane::instance()->addTestResult(FaultyTestResult(Result::MESSAGE_WARN, TestResultsPane::instance()->addTestResult(FaultyTestResult(Result::MESSAGE_WARN,
tr("*** Project's run configuration was guessed for '%1' ***\n" tr("Project's run configuration was guessed for \"%1\".\n"
"This might cause trouble during execution.").arg(config->displayName()))); "This might cause trouble during execution.").arg(config->displayName())));
} }
} }
@@ -217,16 +217,16 @@ void TestRunner::runTests()
if (m_selectedTests.empty()) { if (m_selectedTests.empty()) {
TestResultsPane::instance()->addTestResult(FaultyTestResult(Result::MESSAGE_WARN, TestResultsPane::instance()->addTestResult(FaultyTestResult(Result::MESSAGE_WARN,
tr("*** No tests selected - canceling Test Run ***"))); tr("No tests selected. Canceling test run.")));
return; return;
} }
ProjectExplorer::Project *project = m_selectedTests.at(0)->project(); ProjectExplorer::Project *project = m_selectedTests.at(0)->project();
if (!project) { if (!project) {
TestResultsPane::instance()->addTestResult(FaultyTestResult(Result::MESSAGE_WARN, TestResultsPane::instance()->addTestResult(FaultyTestResult(Result::MESSAGE_WARN,
tr("*** Project is null - canceling Test Run ***\n" tr("Project is null. Canceling test run.\n"
"Actually only Desktop kits are supported - make sure the " "Only desktop kits are supported. Make sure the "
"current active kit is a Desktop kit."))); "currently active kit is a desktop kit.")));
return; return;
} }
@@ -235,7 +235,7 @@ void TestRunner::runTests()
if (projectExplorerSettings.buildBeforeDeploy) { if (projectExplorerSettings.buildBeforeDeploy) {
if (!project->hasActiveBuildSettings()) { if (!project->hasActiveBuildSettings()) {
TestResultsPane::instance()->addTestResult(FaultyTestResult(Result::MESSAGE_FATAL, TestResultsPane::instance()->addTestResult(FaultyTestResult(Result::MESSAGE_FATAL,
tr("*** Project is not configured - canceling Test Run ***"))); tr("Project is not configured. Canceling test run.")));
return; return;
} }
buildProject(project); buildProject(project);
@@ -245,7 +245,7 @@ void TestRunner::runTests()
if (!m_buildSucceeded) { if (!m_buildSucceeded) {
TestResultsPane::instance()->addTestResult(FaultyTestResult(Result::MESSAGE_FATAL, TestResultsPane::instance()->addTestResult(FaultyTestResult(Result::MESSAGE_FATAL,
tr("*** Build failed - canceling Test Run ***"))); tr("Build failed. Canceling test run.")));
return; return;
} }
} }

View File

@@ -32,7 +32,7 @@
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="toolTip"> <property name="toolTip">
<string>Timeout used when executing test cases. This will apply for each test case on its own, not the whole project.</string> <string>Timeout used when executing each test case.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Timeout:</string> <string>Timeout:</string>
@@ -83,10 +83,10 @@
<item> <item>
<widget class="QCheckBox" name="omitInternalMsgCB"> <widget class="QCheckBox" name="omitInternalMsgCB">
<property name="toolTip"> <property name="toolTip">
<string>If checked Internal Messages won't be shown by default. (You can still enable them on the test results filter)</string> <string>Hides internal messages by default. You can still enable them by using the test results filter.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Omit Internal Messages</string> <string>Omit internal messages</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@@ -96,10 +96,10 @@
<item> <item>
<widget class="QCheckBox" name="omitRunConfigWarnCB"> <widget class="QCheckBox" name="omitRunConfigWarnCB">
<property name="toolTip"> <property name="toolTip">
<string>If checked Warnings regarding a guessed Run Configuration won't be shown.</string> <string>Hides warnings related to a guessed run configuration.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Omit Run Configuration Warnings</string> <string>Omit run configuration warnings</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -161,7 +161,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Use Walltime metrics for executing benchmarks. (default)</string> <string>Uses walltime metrics for executing benchmarks (default).</string>
</property> </property>
<property name="text"> <property name="text">
<string>Walltime</string> <string>Walltime</string>
@@ -180,10 +180,10 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Use tick counter for executing benchmarks.</string> <string>Uses tick counter when executing benchmarks.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Tickcounter</string> <string>Tick counter</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -196,10 +196,10 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Use event counter when executing benchmarks.</string> <string>Uses event counter when executing benchmarks.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Eventcounter</string> <string>Event counter</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -215,7 +215,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Use callgrind when executing benchmark. (valgrind must be installed)</string> <string>Uses Valgrind Callgrind when executing benchmarks (it must be installed).</string>
</property> </property>
<property name="text"> <property name="text">
<string>Callgrind</string> <string>Callgrind</string>
@@ -234,7 +234,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Use perf when executing benchmarks. (perf must be installed)</string> <string>Uses Perf when executing benchmarks (it must be installed).</string>
</property> </property>
<property name="text"> <property name="text">
<string>Perf</string> <string>Perf</string>

View File

@@ -213,9 +213,8 @@ QVariant TestTreeModel::data(const QModelIndex &index, int role) const
switch(role) { switch(role) {
case Qt::ToolTipRole: case Qt::ToolTipRole:
if (item->type() == TestTreeItem::TEST_CLASS && item->name().isEmpty()) if (item->type() == TestTreeItem::TEST_CLASS && item->name().isEmpty())
return tr("<p>Unnamed test cases can't be (un)checked - avoid this by assigning a name." return tr("<p>Give all test cases a name to ensure correct behavior "
"<br/>Having unnamed test cases invalidates the check state of named test " "when running test cases and to be able to select them.</p>");
"cases with the same main.cpp when executing selected tests.</p>");
return item->filePath(); return item->filePath();
case Qt::DecorationRole: case Qt::DecorationRole:
return testTreeIcon(item->type()); return testTreeIcon(item->type());

View File

@@ -191,7 +191,7 @@ void TestXmlOutputReader::processOutput()
lineNumber = 0; lineNumber = 0;
readingDescription = false; readingDescription = false;
testResultCreated(TestResult(QString(), QString(), QString(), Result::MESSAGE_CURRENT_TEST, testResultCreated(TestResult(QString(), QString(), QString(), Result::MESSAGE_CURRENT_TEST,
QObject::tr("Entering Test Function %1::%2").arg(className).arg(testCase))); QObject::tr("Entering test function %1::%2").arg(className).arg(testCase)));
continue; continue;
} }
if (xmlStartsWith(line, QLatin1String("<Duration msecs=\""), duration)) { if (xmlStartsWith(line, QLatin1String("<Duration msecs=\""), duration)) {
@@ -232,12 +232,12 @@ void TestXmlOutputReader::processOutput()
description = QString(); description = QString();
} else if (line == QLatin1String("</TestFunction>") && !duration.isEmpty()) { } else if (line == QLatin1String("</TestFunction>") && !duration.isEmpty()) {
TestResult testResult(className, testCase, QString(), Result::MESSAGE_INTERNAL, TestResult testResult(className, testCase, QString(), Result::MESSAGE_INTERNAL,
QObject::tr("execution took %1ms").arg(duration)); QObject::tr("Execution took %1 ms.").arg(duration));
testResultCreated(testResult); testResultCreated(testResult);
emit increaseProgress(); emit increaseProgress();
} else if (line == QLatin1String("</TestCase>") && !duration.isEmpty()) { } else if (line == QLatin1String("</TestCase>") && !duration.isEmpty()) {
TestResult testResult(className, QString(), QString(), Result::MESSAGE_INTERNAL, TestResult testResult(className, QString(), QString(), Result::MESSAGE_INTERNAL,
QObject::tr("Test execution took %1ms").arg(duration)); QObject::tr("Test execution took %1 ms.").arg(duration));
testResultCreated(testResult); testResultCreated(testResult);
} else if (readingDescription) { } else if (readingDescription) {
if (line.endsWith(QLatin1String("]]></Description>"))) { if (line.endsWith(QLatin1String("]]></Description>"))) {
@@ -250,10 +250,10 @@ void TestXmlOutputReader::processOutput()
} }
} else if (xmlStartsWith(line, QLatin1String("<QtVersion>"), qtVersion)) { } else if (xmlStartsWith(line, QLatin1String("<QtVersion>"), qtVersion)) {
testResultCreated(FaultyTestResult(Result::MESSAGE_INTERNAL, testResultCreated(FaultyTestResult(Result::MESSAGE_INTERNAL,
QObject::tr("Qt Version: %1").arg(qtVersion))); QObject::tr("Qt version: %1").arg(qtVersion)));
} else if (xmlStartsWith(line, QLatin1String("<QTestVersion>"), qtestVersion)) { } else if (xmlStartsWith(line, QLatin1String("<QTestVersion>"), qtestVersion)) {
testResultCreated(FaultyTestResult(Result::MESSAGE_INTERNAL, testResultCreated(FaultyTestResult(Result::MESSAGE_INTERNAL,
QObject::tr("QTest Version: %1").arg(qtestVersion))); QObject::tr("QTest version: %1").arg(qtestVersion)));
} else { } else {
// qDebug() << "Unhandled line:" << line; // TODO remove // qDebug() << "Unhandled line:" << line; // TODO remove
} }