tst_qmimedatabase: Add some log output when running update-mime-database.

When running the test, one gets the impression that it hangs.
Add some debug output including time to show what happens.

Change-Id: Iac6b4f0518ecec62169bf2269a0a8ec9192da570
Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
Friedemann Kleint 2015-07-14 15:34:58 +02:00
parent 99b94aadf8
commit 696ea2fff1

View File

@ -35,6 +35,7 @@
#include "qstandardpaths.h"
#include <QtCore/QElapsedTimer>
#include <QtCore/QFile>
#include <QtCore/QFileInfo>
#include <QtCore/QTextStream>
@ -765,16 +766,20 @@ static bool runUpdateMimeDatabase(const QString &path) // TODO make it a QMimeDa
return false;
}
QElapsedTimer timer;
QProcess proc;
proc.setProcessChannelMode(QProcess::MergedChannels); // silence output
qDebug().noquote() << "runUpdateMimeDatabase: running" << umd << path << "...";
timer.start();
proc.start(umd, QStringList(path));
if (!proc.waitForStarted()) {
qWarning("Cannot start %s: %s",
qPrintable(umd), qPrintable(proc.errorString()));
return false;
}
proc.waitForFinished();
//qDebug() << "runUpdateMimeDatabase" << path;
const bool success = proc.waitForFinished();
qDebug().noquote() << "runUpdateMimeDatabase: done,"
<< success << timer.elapsed() << "ms";
return true;
}