forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user