Commit 12f1f3b4 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Make debug logs more readable by adding clock time.

This should help diagnose if timeouts occur due to a hang or just a slow test.
parent c85cca33
......@@ -128,7 +128,6 @@ bool pqEventDispatcher::playEvents(pqEventSource& source, pqEventPlayer& player)
// playback loop, and it continues.
this->PlayBackStatus = true; // success.
this->PlayBackFinished = false;
this->PlaybackStartTime = QTime::currentTime();
while (!this->PlayBackFinished)
{
this->playEvent();
......@@ -207,7 +206,8 @@ void pqEventDispatcher::playEvent(int indent)
#endif
if (print_debug)
{
cout << QTime::currentTime().secsTo(this->PlaybackStartTime) << " : "
cout << QTime::currentTime().toString("hh:mm:ss").toStdString().c_str()
<< " : "
<< QString().fill(' ', 4*indent).toStdString().c_str()
<< local_counter << ": Test (" << indent << "): "
<< pretty_name.toStdString().c_str() << ": "
......@@ -220,16 +220,21 @@ void pqEventDispatcher::playEvent(int indent)
this->BlockTimer.stop();
//QCoreApplication::sendPostedEvents();
//QCoreApplication::flush();
if (print_debug) { cout << " -- pre-processEventsAndWait: " <<
local_counter <<endl;}
this->processEventsAndWait(QT_TESTING_EVENT_PLAYBACK_DELAY); // let what's going to happen after the
// playback, happen.
if (print_debug) { cout << " -- post-processEventsAndWait: " <<
local_counter <<endl;}
if (print_debug)
{
cout << " -- pre-processEventsAndWait: " << local_counter <<endl;
}
// let what's going to happen after the playback, happen.
this->processEventsAndWait(QT_TESTING_EVENT_PLAYBACK_DELAY);
if (print_debug)
{
cout << " -- post-processEventsAndWait: " << local_counter <<endl;
}
this->BlockTimer.stop();
if (print_debug)
{
cout << QTime::currentTime().secsTo(this->PlaybackStartTime) << " : "
cout << QTime::currentTime().toString("hh:mm:ss").toStdString().c_str()
<< " : "
<< QString().fill(' ', 4*indent).toStdString().c_str()
<< local_counter << ": Done" << endl;
}
......
......@@ -84,7 +84,6 @@ protected:
pqEventSource* ActiveSource;
pqEventPlayer* ActivePlayer;
QTimer BlockTimer;
QTime PlaybackStartTime;
};
#endif // !_pqEventDispatcher_h
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment