AutoTest: Add some logging to test runner

This may help for issues which are not easily
reproducible.

Change-Id: If8063c51f69bd24f12afdcdd0648790f1a0668da
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2019-10-16 10:28:21 +02:00
parent f5e25c50db
commit 3e56a2b81e

View File

@@ -39,6 +39,9 @@
#include <coreplugin/progressmanager/futureprogress.h> #include <coreplugin/progressmanager/futureprogress.h>
#include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/progressmanager/progressmanager.h>
#include <debugger/debuggerkitinformation.h>
#include <debugger/debuggerruncontrol.h>
#include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/buildmanager.h> #include <projectexplorer/buildmanager.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
@@ -48,6 +51,7 @@
#include <projectexplorer/session.h> #include <projectexplorer/session.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <utils/algorithm.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/outputformat.h> #include <utils/outputformat.h>
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
@@ -59,21 +63,19 @@
#include <QFuture> #include <QFuture>
#include <QFutureInterface> #include <QFutureInterface>
#include <QLabel> #include <QLabel>
#include <QLoggingCategory>
#include <QProcess> #include <QProcess>
#include <QPushButton> #include <QPushButton>
#include <QTimer> #include <QTimer>
#include <debugger/debuggerkitinformation.h>
#include <debugger/debuggerruncontrol.h>
#include <utils/algorithm.h>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Utils; using namespace Utils;
namespace Autotest { namespace Autotest {
namespace Internal { namespace Internal {
static Q_LOGGING_CATEGORY(runnerLog, "qtc.autotest.testrunner", QtWarningMsg)
static TestRunner *s_instance = nullptr; static TestRunner *s_instance = nullptr;
TestRunner *TestRunner::instance() TestRunner *TestRunner::instance()
@@ -231,6 +233,11 @@ void TestRunner::scheduleNext()
const int timeout = AutotestPlugin::settings()->timeout; const int timeout = AutotestPlugin::settings()->timeout;
QTimer::singleShot(timeout, m_currentProcess, [this]() { cancelCurrent(Timeout); }); QTimer::singleShot(timeout, m_currentProcess, [this]() { cancelCurrent(Timeout); });
qCInfo(runnerLog) << "Command:" << m_currentProcess->program();
qCInfo(runnerLog) << "Arguments:" << m_currentProcess->arguments();
qCInfo(runnerLog) << "Working directory:" << m_currentProcess->workingDirectory();
qCDebug(runnerLog) << "Environment:" << m_currentProcess->environment();
m_currentProcess->start(); m_currentProcess->start();
if (!m_currentProcess->waitForStarted()) { if (!m_currentProcess->waitForStarted()) {
reportResult(ResultType::MessageFatal, reportResult(ResultType::MessageFatal,