Skip to content

Commit

Permalink
AutoTest: Tweak behavior of show durations
Browse files Browse the repository at this point in the history
The action on the tool bar only toggled between showing the
additional duration column or not.
Now this also filters out messages used to mark end of tests
and propagate its duration as these never could get filtered
explicitly with any active filter as they get treated
internally.

Task-number: QTCREATORBUG-32452
Change-Id: If7410e03c7bfea1c6bfef1389bac8552633f57f6
  • Loading branch information
Christian Stenger committed Feb 7, 2025
1 parent ea1814d commit fb980e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plugins/autotest/testresultmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,8 @@ bool TestResultFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &s
auto item = m_sourceModel->itemForIndex(index);
return item && item->descendantTypesContainsAnyOf(m_enabled);
} else if (resultType == ResultType::TestEnd) {
if (!TestResultsPane::instance()->showDurations())
return false;
auto item = m_sourceModel->itemForIndex(index);
if (!item)
return false;
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/autotest/testresultspane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,4 +772,10 @@ void TestResultsPane::showTestResult(const QModelIndex &index)
}
}

bool TestResultsPane::showDurations() const
{
QTC_ASSERT(m_showDurationButton, return false);
return m_showDurationButton->isChecked();
}

} // namespace Autotest::Internal
2 changes: 2 additions & 0 deletions src/plugins/autotest/testresultspane.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ class TestResultsPane : public Core::IOutputPane
void addTestResult(const TestResult &result);
void addOutputLine(const QByteArray &outputLine, OutputChannel channel);
void showTestResult(const QModelIndex &index);

bool showDurations() const;
private:
explicit TestResultsPane(QObject *parent = nullptr);

Expand Down

0 comments on commit fb980e5

Please sign in to comment.