aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-07-18 18:13:18 +0200
committerKitsune Ral <Kitsune-Ral@users.sf.net>2020-07-18 18:13:34 +0200
commit8da4918aa10340ef52177977a8bcad489419f8e2 (patch)
tree3fada75e9b6a77f7fcb871cd765170933f9ff191
parentb1e84568dbb70dc4fa24a915c6d15438be958378 (diff)
downloadlibquotient-8da4918aa10340ef52177977a8bcad489419f8e2.tar.gz
libquotient-8da4918aa10340ef52177977a8bcad489419f8e2.zip
quotest: log final report as late as possible
...to spare the developer from scrolling up in the search of it.
-rw-r--r--tests/quotest.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/quotest.cpp b/tests/quotest.cpp
index e47bf651..b06665a9 100644
--- a/tests/quotest.cpp
+++ b/tests/quotest.cpp
@@ -614,12 +614,10 @@ TEST_IMPL(markDirectChat)
void TestManager::conclude()
{
- auto succeededRec = QString::number(succeeded.size()) + " tests succeeded";
- if (!failed.empty() || !running.empty())
- succeededRec +=
- " of "
- % QString::number(succeeded.size() + failed.size() + running.size())
- % " total";
+ QString succeededRec { QString::number(succeeded.size()) % " of "
+ % QString::number(succeeded.size() + failed.size()
+ + running.size())
+ % " tests succeeded" };
QString plainReport = origin % ": Testing complete, " % succeededRec;
QString color = failed.empty() && running.empty() ? "00AA00" : "AA0000";
QString htmlReport = origin % ": <strong><font data-mx-color='#" % color
@@ -639,7 +637,6 @@ void TestManager::conclude()
plainReport += "\nDID NOT FINISH:" + dnfList;
htmlReport += "<br><strong>Did not finish:</strong>" + dnfList;
}
- clog << plainReport.toStdString() << endl;
// TODO: Waiting for proper futures to come so that it could be:
// targetRoom->postHtmlText(...)
@@ -648,7 +645,7 @@ void TestManager::conclude()
auto* room = testSuite->room();
auto txnId = room->postHtmlText(plainReport, htmlReport);
// Now just wait until all the pending events reach the server
- connectUntil(room, &Room::messageSent, this, [this, room] {
+ connectUntil(room, &Room::messageSent, this, [this, room, plainReport] {
const auto& pendingEvents = room->pendingEvents();
if (auto c = std::count_if(pendingEvents.begin(), pendingEvents.end(),
[](const PendingEventItem& pe) {
@@ -663,9 +660,11 @@ void TestManager::conclude()
clog << "Leaving the room" << endl;
auto* job = room->leaveRoom();
- connect(job, &BaseJob::finished, this, [this, job] {
+ connect(job, &BaseJob::finished, this, [this, job,plainReport] {
Q_ASSERT(job->status().good());
finalize();
+ // Still flying, as the exit() connection in finalize() is queued
+ clog << plainReport.toStdString() << endl;
});
return true;
});