Unit tests: Print a warning at the end if not all tests passed

It's easy to overlook that Creator returned with a non-zero exit code,
particularly if the last test succeeded.

Change-Id: I6975014aec36c7a267dc88cde41f830d314c90af
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Kandeler
2019-03-13 14:38:07 +01:00
parent 7a4752bde5
commit 4eff36b7f6

View File

@@ -33,9 +33,10 @@
#include <utils/qtcassert.h>
#include <QSysInfo>
#include <QApplication>
#include <QDebug>
#include <QStandardPaths>
#include <QSysInfo>
/*!
\namespace Core
@@ -332,6 +333,8 @@ ICore::ICore(MainWindow *mainwindow)
this, &ICore::saveSettings);
connect(PluginManager::instance(), &PluginManager::testsFinished, [this] (int failedTests) {
emit coreAboutToClose();
if (failedTests != 0)
qWarning("Test run was not successful: %d test(s) failed.", failedTests);
QCoreApplication::exit(failedTests);
});
}