Dumper-tests: Adds Logging Category for easy debug msg suppression

Change-Id: Ic871558f7ef82489030e574e8997277221e0b63d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Marcus Tillmanns
2022-08-16 13:30:41 +02:00
parent 71f0597e49
commit 7e37899565

View File

@@ -32,6 +32,7 @@
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <QLoggingCategory>
#include <QtTest> #include <QtTest>
#include <math.h> #include <math.h>
@@ -41,6 +42,8 @@
#define MSKIP_SINGLE(x) do { disarm(); QSKIP(x); } while (0) #define MSKIP_SINGLE(x) do { disarm(); QSKIP(x); } while (0)
Q_LOGGING_CATEGORY(lcDumpers, "qtc.debugger.dumpers", QtDebugMsg)
using namespace Debugger; using namespace Debugger;
using namespace Internal; using namespace Internal;
@@ -338,8 +341,8 @@ struct Value
if (isFloatValue) { if (isFloatValue) {
double f1 = fabs(expectedValue.toDouble()); double f1 = fabs(expectedValue.toDouble());
double f2 = fabs(actualValue.toDouble()); double f2 = fabs(actualValue.toDouble());
//qDebug() << "expected float: " << qPrintable(expectedValue) << f1; //qCDebug(lcDumpers) << "expected float: " << qPrintable(expectedValue) << f1;
//qDebug() << "actual float: " << qPrintable(actualValue) << f2; //qCDebug(lcDumpers) << "actual float: " << qPrintable(actualValue) << f2;
if (f1 < f2) if (f1 < f2)
std::swap(f1, f2); std::swap(f1, f2);
return f1 - f2 <= 0.01 * f2; return f1 - f2 <= 0.01 * f2;
@@ -1184,7 +1187,7 @@ void tst_Dumpers::initTestCase()
m_debuggerBinary = "gdb"; m_debuggerBinary = "gdb";
#endif #endif
} }
qDebug() << "Debugger : " << m_debuggerBinary; qCDebug(lcDumpers) << "Debugger : " << m_debuggerBinary;
m_debuggerEngine = GdbEngine; m_debuggerEngine = GdbEngine;
if (m_debuggerBinary.endsWith("cdb.exe")) if (m_debuggerBinary.endsWith("cdb.exe"))
@@ -1200,14 +1203,14 @@ void tst_Dumpers::initTestCase()
if (qEnvironmentVariableIntValue("QTC_USE_CMAKE_FOR_TEST")) if (qEnvironmentVariableIntValue("QTC_USE_CMAKE_FOR_TEST"))
m_buildSystem = BuildSystem::CMake; m_buildSystem = BuildSystem::CMake;
qDebug() << "QMake : " << m_qmakeBinary; qCDebug(lcDumpers) << "QMake : " << m_qmakeBinary;
qDebug() << "Use CMake : " << (m_buildSystem == BuildSystem::CMake) << int(m_buildSystem); qCDebug(lcDumpers) << "Use CMake : " << (m_buildSystem == BuildSystem::CMake) << int(m_buildSystem);
m_useGLibCxxDebug = qgetenv("QTC_USE_GLIBCXXDEBUG_FOR_TEST").toInt(); m_useGLibCxxDebug = qgetenv("QTC_USE_GLIBCXXDEBUG_FOR_TEST").toInt();
qDebug() << "Use _GLIBCXX_DEBUG : " << m_useGLibCxxDebug; qCDebug(lcDumpers) << "Use _GLIBCXX_DEBUG : " << m_useGLibCxxDebug;
m_forceKeepTemp = qgetenv("QTC_KEEP_TEMP_FOR_TEST").toInt(); m_forceKeepTemp = qgetenv("QTC_KEEP_TEMP_FOR_TEST").toInt();
qDebug() << "Force keep temp : " << m_forceKeepTemp; qCDebug(lcDumpers) << "Force keep temp : " << m_forceKeepTemp;
if (m_debuggerEngine == GdbEngine) { if (m_debuggerEngine == GdbEngine) {
QProcess debugger; QProcess debugger;
@@ -1217,10 +1220,10 @@ void tst_Dumpers::initTestCase()
ok = debugger.waitForFinished(); ok = debugger.waitForFinished();
QVERIFY(ok); QVERIFY(ok);
QByteArray output = debugger.readAllStandardOutput(); QByteArray output = debugger.readAllStandardOutput();
//qDebug().noquote() << "stdout: " << output; //qCDebug(lcDumpers).noquote() << "stdout: " << output;
bool usePython = !output.contains("Python scripting is not supported in this copy of GDB"); bool usePython = !output.contains("Python scripting is not supported in this copy of GDB");
qDebug() << "Python : " << (usePython ? "ok" : "*** not ok ***"); qCDebug(lcDumpers) << "Python : " << (usePython ? "ok" : "*** not ok ***");
qDebug() << "Dumper dir : " << DUMPERDIR; qCDebug(lcDumpers) << "Dumper dir : " << DUMPERDIR;
QVERIFY(usePython); QVERIFY(usePython);
QString version = QString::fromLocal8Bit(output); QString version = QString::fromLocal8Bit(output);
@@ -1249,8 +1252,8 @@ void tst_Dumpers::initTestCase()
if (m_makeBinary.isEmpty()) if (m_makeBinary.isEmpty())
m_makeBinary = "make"; m_makeBinary = "make";
#endif #endif
qDebug() << "Make path : " << m_makeBinary; qCDebug(lcDumpers) << "Make path : " << m_makeBinary;
qDebug() << "Gdb version : " << m_debuggerVersion; qCDebug(lcDumpers) << "Gdb version : " << m_debuggerVersion;
} else if (m_debuggerEngine == CdbEngine) { } else if (m_debuggerEngine == CdbEngine) {
QByteArray envBat = qgetenv("QTC_MSVC_ENV_BAT"); QByteArray envBat = qgetenv("QTC_MSVC_ENV_BAT");
QMap <QString, QString> envPairs; QMap <QString, QString> envPairs;
@@ -1274,13 +1277,13 @@ void tst_Dumpers::initTestCase()
int pos = output.indexOf('\n'); int pos = output.indexOf('\n');
if (pos != -1) if (pos != -1)
output = output.left(pos); output = output.left(pos);
qDebug() << "Extracting MSVC version from: " << output; qCDebug(lcDumpers) << "Extracting MSVC version from: " << output;
QRegularExpression reg(" (\\d\\d)\\.(\\d\\d)\\."); QRegularExpression reg(" (\\d\\d)\\.(\\d\\d)\\.");
QRegularExpressionMatch match = reg.match(output); QRegularExpressionMatch match = reg.match(output);
if (match.matchType() != QRegularExpression::NoMatch) if (match.matchType() != QRegularExpression::NoMatch)
m_msvcVersion = QString(match.captured(1) + match.captured(2)).toInt(); m_msvcVersion = QString(match.captured(1) + match.captured(2)).toInt();
} else if (m_debuggerEngine == LldbEngine) { } else if (m_debuggerEngine == LldbEngine) {
qDebug() << "Dumper dir : " << DUMPERDIR; qCDebug(lcDumpers) << "Dumper dir : " << DUMPERDIR;
QProcess debugger; QProcess debugger;
debugger.start(m_debuggerBinary, {"-v"}); debugger.start(m_debuggerBinary, {"-v"});
bool ok = debugger.waitForFinished(2000); bool ok = debugger.waitForFinished(2000);
@@ -1306,7 +1309,7 @@ void tst_Dumpers::initTestCase()
} }
} }
qDebug() << "Lldb version :" << output << ba << m_debuggerVersion; qCDebug(lcDumpers) << "Lldb version :" << output << ba << m_debuggerVersion;
QVERIFY(m_debuggerVersion); QVERIFY(m_debuggerVersion);
m_env = QProcessEnvironment::systemEnvironment(); m_env = QProcessEnvironment::systemEnvironment();
@@ -1369,8 +1372,8 @@ void tst_Dumpers::dumper()
error = qmake.readAllStandardError(); error = qmake.readAllStandardError();
int pos0 = output.indexOf("Qt version"); int pos0 = output.indexOf("Qt version");
if (pos0 == -1) { if (pos0 == -1) {
qDebug().noquote() << "Output: " << output; qCDebug(lcDumpers).noquote() << "Output: " << output;
qDebug().noquote() << "Error: " << error; qCDebug(lcDumpers).noquote() << "Error: " << error;
QVERIFY(false); QVERIFY(false);
} }
pos0 += 11; pos0 += 11;
@@ -1400,7 +1403,7 @@ void tst_Dumpers::dumper()
int pos = output.indexOf('\n'); int pos = output.indexOf('\n');
if (pos != -1) if (pos != -1)
output = output.left(pos); output = output.left(pos);
qDebug() << "Extracting GCC version from: " << output; qCDebug(lcDumpers) << "Extracting GCC version from: " << output;
if (output.contains(QByteArray("SUSE Linux"))) { if (output.contains(QByteArray("SUSE Linux"))) {
pos = output.indexOf(')'); pos = output.indexOf(')');
output = output.mid(pos + 1).trimmed(); output = output.mid(pos + 1).trimmed();
@@ -1416,7 +1419,7 @@ void tst_Dumpers::dumper()
int minor = output.mid(pos1, pos2++ - pos1).toInt(); int minor = output.mid(pos1, pos2++ - pos1).toInt();
int patch = output.mid(pos2).toInt(); int patch = output.mid(pos2).toInt();
m_gccVersion = 10000 * major + 100 * minor + patch; m_gccVersion = 10000 * major + 100 * minor + patch;
qDebug() << "GCC version: " << m_gccVersion; qCDebug(lcDumpers) << "GCC version: " << m_gccVersion;
if (data.neededGccVersion.min > m_gccVersion) if (data.neededGccVersion.min > m_gccVersion)
MSKIP_SINGLE(QByteArray("Need minimum GCC version " MSKIP_SINGLE(QByteArray("Need minimum GCC version "
@@ -1635,23 +1638,23 @@ void tst_Dumpers::dumper()
"-DCMAKE_PREFIX_PATH=" + dir.absolutePath(), "-DCMAKE_PREFIX_PATH=" + dir.absolutePath(),
"." "."
}; };
//qDebug() << "Starting cmake: " << m_cmakeBinary << ' ' << qPrintable(options.join(' ')); //qCDebug(lcDumpers) << "Starting cmake: " << m_cmakeBinary << ' ' << qPrintable(options.join(' '));
cmake.setProcessEnvironment(m_env); cmake.setProcessEnvironment(m_env);
cmake.start(m_cmakeBinary, options); cmake.start(m_cmakeBinary, options);
QVERIFY(cmake.waitForFinished()); QVERIFY(cmake.waitForFinished());
output = cmake.readAllStandardOutput(); output = cmake.readAllStandardOutput();
error = cmake.readAllStandardError(); error = cmake.readAllStandardError();
//qDebug() << "stdout: " << output; //qCDebug(lcDumpers) << "stdout: " << output;
if (data.allProfile.isEmpty()) { // Nim... if (data.allProfile.isEmpty()) { // Nim...
if (!error.isEmpty()) { if (!error.isEmpty()) {
qDebug() << error; QVERIFY(false); qCDebug(lcDumpers) << error; QVERIFY(false);
} }
} }
} else { } else {
QProcess qmake; QProcess qmake;
qmake.setWorkingDirectory(t->buildPath); qmake.setWorkingDirectory(t->buildPath);
//qDebug() << "Starting qmake: " << m_qmakeBinary; //qCDebug(lcDumpers) << "Starting qmake: " << m_qmakeBinary;
QStringList options; QStringList options;
#ifdef Q_OS_MACOS #ifdef Q_OS_MACOS
if (m_qtVersion && m_qtVersion < 0x050000) if (m_qtVersion && m_qtVersion < 0x050000)
@@ -1662,11 +1665,11 @@ void tst_Dumpers::dumper()
QVERIFY(qmake.waitForFinished()); QVERIFY(qmake.waitForFinished());
output = qmake.readAllStandardOutput(); output = qmake.readAllStandardOutput();
error = qmake.readAllStandardError(); error = qmake.readAllStandardError();
//qDebug() << "stdout: " << output; //qCDebug(lcDumpers) << "stdout: " << output;
if (data.allProfile.isEmpty()) { // Nim... if (data.allProfile.isEmpty()) { // Nim...
if (!error.isEmpty()) { if (!error.isEmpty()) {
qDebug() << error; QVERIFY(qmake.exitCode() == 0); qCDebug(lcDumpers) << error; QVERIFY(qmake.exitCode() == 0);
} }
} }
} }
@@ -1679,16 +1682,16 @@ void tst_Dumpers::dumper()
QVERIFY(make.waitForFinished()); QVERIFY(make.waitForFinished());
output = make.readAllStandardOutput(); output = make.readAllStandardOutput();
error = make.readAllStandardError(); error = make.readAllStandardError();
//qDebug() << "stdout: " << output; //qCDebug(lcDumpers) << "stdout: " << output;
if (make.exitCode()) { if (make.exitCode()) {
if (data.useBoost && make.exitStatus() == QProcess::NormalExit) if (data.useBoost && make.exitStatus() == QProcess::NormalExit)
MSKIP_SINGLE("Compile failed - probably missing Boost?"); MSKIP_SINGLE("Compile failed - probably missing Boost?");
qDebug().noquote() << error; qCDebug(lcDumpers).noquote() << error;
qDebug() << "\n------------------ CODE --------------------"; qCDebug(lcDumpers) << "\n------------------ CODE --------------------";
qDebug().noquote() << fullCode; qCDebug(lcDumpers).noquote() << fullCode;
qDebug() << "\n------------------ CODE --------------------"; qCDebug(lcDumpers) << "\n------------------ CODE --------------------";
qDebug().noquote() << "Project file: " << projectFile.fileName(); qCDebug(lcDumpers).noquote() << "Project file: " << projectFile.fileName();
QCOMPARE(make.exitCode(), 0); QCOMPARE(make.exitCode(), 0);
} }
@@ -1702,9 +1705,9 @@ void tst_Dumpers::dumper()
int pos1 = output.indexOf("Version:") + 8; int pos1 = output.indexOf("Version:") + 8;
int pos2 = output.indexOf("\n", pos1); int pos2 = output.indexOf("\n", pos1);
int dwarfVersion = output.mid(pos1, pos2 - pos1).toInt(); int dwarfVersion = output.mid(pos1, pos2 - pos1).toInt();
//qDebug() << "OUT: " << output; //qCDebug(lcDumpers) << "OUT: " << output;
//qDebug() << "ERR: " << error; //qCDebug(lcDumpers) << "ERR: " << error;
qDebug() << "DWARF Version : " << dwarfVersion; qCDebug(lcDumpers) << "DWARF Version : " << dwarfVersion;
if (data.neededDwarfVersion.min > dwarfVersion) if (data.neededDwarfVersion.min > dwarfVersion)
MSKIP_SINGLE(QByteArray("Need minimum DWARF version " MSKIP_SINGLE(QByteArray("Need minimum DWARF version "
@@ -1835,10 +1838,10 @@ void tst_Dumpers::dumper()
QVERIFY(debugger.waitForFinished()); QVERIFY(debugger.waitForFinished());
output = debugger.readAllStandardOutput(); output = debugger.readAllStandardOutput();
QByteArray fullOutput = output; QByteArray fullOutput = output;
//qDebug() << "stdout: " << output; //qCDebug(lcDumpers) << "stdout: " << output;
error = debugger.readAllStandardError(); error = debugger.readAllStandardError();
if (!error.isEmpty()) if (!error.isEmpty())
qDebug() << error; qCDebug(lcDumpers) << error;
if (keepTemp()) { if (keepTemp()) {
QFile logger(t->buildPath + "/output.txt"); QFile logger(t->buildPath + "/output.txt");
@@ -1855,7 +1858,7 @@ void tst_Dumpers::dumper()
if (m_debuggerEngine == GdbEngine) { if (m_debuggerEngine == GdbEngine) {
int posDataStart = output.indexOf("data="); int posDataStart = output.indexOf("data=");
if (posDataStart == -1) { if (posDataStart == -1) {
qDebug().noquote() << "NO \"data=\" IN OUTPUT: " << output; qCDebug(lcDumpers).noquote() << "NO \"data=\" IN OUTPUT: " << output;
QVERIFY(posDataStart != -1); QVERIFY(posDataStart != -1);
} }
contents = output.mid(posDataStart); contents = output.mid(posDataStart);
@@ -1864,10 +1867,10 @@ void tst_Dumpers::dumper()
actual.fromStringMultiple(QString::fromLocal8Bit(contents)); actual.fromStringMultiple(QString::fromLocal8Bit(contents));
context.nameSpace = actual["qtnamespace"].data(); context.nameSpace = actual["qtnamespace"].data();
actual = actual["data"]; actual = actual["data"];
//qDebug() << "FOUND NS: " << context.nameSpace; //qCDebug(lcDumpers) << "FOUND NS: " << context.nameSpace;
} else if (m_debuggerEngine == LldbEngine) { } else if (m_debuggerEngine == LldbEngine) {
//qDebug().noquote() << "GOT OUTPUT: " << output; //qCDebug(lcDumpers).noquote() << "GOT OUTPUT: " << output;
int pos = output.indexOf("data=[{"); int pos = output.indexOf("data=[{");
QVERIFY(pos != -1); QVERIFY(pos != -1);
output = output.mid(pos); output = output.mid(pos);
@@ -1875,14 +1878,14 @@ void tst_Dumpers::dumper()
int posNameSpaceStart = output.indexOf("@NS@"); int posNameSpaceStart = output.indexOf("@NS@");
if (posNameSpaceStart == -1) if (posNameSpaceStart == -1)
qDebug().noquote() << "OUTPUT: " << output; qCDebug(lcDumpers).noquote() << "OUTPUT: " << output;
QVERIFY(posNameSpaceStart != -1); QVERIFY(posNameSpaceStart != -1);
posNameSpaceStart += sizeof("@NS@") - 1; posNameSpaceStart += sizeof("@NS@") - 1;
int posNameSpaceEnd = output.indexOf("@", posNameSpaceStart); int posNameSpaceEnd = output.indexOf("@", posNameSpaceStart);
QVERIFY(posNameSpaceEnd != -1); QVERIFY(posNameSpaceEnd != -1);
context.nameSpace = QString::fromLocal8Bit(output.mid( context.nameSpace = QString::fromLocal8Bit(output.mid(
posNameSpaceStart, posNameSpaceEnd - posNameSpaceStart)); posNameSpaceStart, posNameSpaceEnd - posNameSpaceStart));
//qDebug() << "FOUND NS: " << context.nameSpace; //qCDebug(lcDumpers) << "FOUND NS: " << context.nameSpace;
if (context.nameSpace == "::") if (context.nameSpace == "::")
context.nameSpace.clear(); context.nameSpace.clear();
contents.replace("\\\"", "\""); contents.replace("\\\"", "\"");
@@ -1892,7 +1895,7 @@ void tst_Dumpers::dumper()
QByteArray locals("|script|"); QByteArray locals("|script|");
int localsBeginPos = output.indexOf(locals, output.indexOf(localsAnswerStart)); int localsBeginPos = output.indexOf(locals, output.indexOf(localsAnswerStart));
if (localsBeginPos == -1) if (localsBeginPos == -1)
qDebug().noquote() << "OUTPUT: " << output; qCDebug(lcDumpers).noquote() << "OUTPUT: " << output;
QVERIFY(localsBeginPos != -1); QVERIFY(localsBeginPos != -1);
do { do {
const int msgStart = localsBeginPos + locals.length(); const int msgStart = localsBeginPos + locals.length();
@@ -1934,14 +1937,14 @@ void tst_Dumpers::dumper()
} }
//qDebug() << "QT VERSION " << QByteArray::number(context.qtVersion, 16); //qCDebug(lcDumpers) << "QT VERSION " << QByteArray::number(context.qtVersion, 16);
QSet<QString> seenINames; QSet<QString> seenINames;
bool ok = true; bool ok = true;
auto test = [&](const Check &check, bool *removeIt, bool single) { auto test = [&](const Check &check, bool *removeIt, bool single) {
if (!check.matches(m_debuggerEngine, m_debuggerVersion, context)) { if (!check.matches(m_debuggerEngine, m_debuggerVersion, context)) {
if (single) if (single)
qDebug() << "SKIPPING NON-MATCHING TEST " << check; qCDebug(lcDumpers) << "SKIPPING NON-MATCHING TEST " << check;
return true; // we have not failed return true; // we have not failed
} }
@@ -1952,38 +1955,38 @@ void tst_Dumpers::dumper()
if (!item) { if (!item) {
if (check.optionallyPresent) if (check.optionallyPresent)
return true; return true;
qDebug() << "NOT SEEN: " << check.iname; qCDebug(lcDumpers) << "NOT SEEN: " << check.iname;
return false; return false;
} }
seenINames.insert(iname); seenINames.insert(iname);
//qDebug() << "CHECKS" << i << check.iname; //qCDebug(lcDumpers) << "CHECKS" << i << check.iname;
*removeIt = true; *removeIt = true;
//qDebug() << "USING MATCHING TEST FOR " << iname; //qCDebug(lcDumpers) << "USING MATCHING TEST FOR " << iname;
QString name = item->realName(); QString name = item->realName();
QString type = item->type; QString type = item->type;
if (!check.expectedName.matches(name, context)) { if (!check.expectedName.matches(name, context)) {
if (single) { if (single) {
qDebug() << "INAME : " << iname; qCDebug(lcDumpers) << "INAME : " << iname;
qDebug() << "NAME ACTUAL : " << name; qCDebug(lcDumpers) << "NAME ACTUAL : " << name;
qDebug() << "NAME EXPECTED: " << check.expectedName.name; qCDebug(lcDumpers) << "NAME EXPECTED: " << check.expectedName.name;
} }
return false; return false;
} }
if (!check.expectedValue.matches(item->value, context)) { if (!check.expectedValue.matches(item->value, context)) {
if (single) { if (single) {
qDebug() << "INAME : " << iname; qCDebug(lcDumpers) << "INAME : " << iname;
qDebug() << "VALUE ACTUAL : " << item->value << toHex(item->value); qCDebug(lcDumpers) << "VALUE ACTUAL : " << item->value << toHex(item->value);
qDebug() << "VALUE EXPECTED: " << check.expectedValue.value << toHex(check.expectedValue.value); qCDebug(lcDumpers) << "VALUE EXPECTED: " << check.expectedValue.value << toHex(check.expectedValue.value);
} }
return false; return false;
} }
if (!check.expectedType.matches(type, context)) { if (!check.expectedType.matches(type, context)) {
if (single) { if (single) {
qDebug() << "INAME : " << iname; qCDebug(lcDumpers) << "INAME : " << iname;
qDebug() << "TYPE ACTUAL : " << type; qCDebug(lcDumpers) << "TYPE ACTUAL : " << type;
qDebug() << "TYPE EXPECTED: " << check.expectedType.type; qCDebug(lcDumpers) << "TYPE EXPECTED: " << check.expectedType.type;
} }
return false; return false;
} }
@@ -2007,9 +2010,9 @@ void tst_Dumpers::dumper()
} }
} }
if (!setok) { if (!setok) {
qDebug() << "NO CHECK IN SET PASSED"; qCDebug(lcDumpers) << "NO CHECK IN SET PASSED";
for (const Check &check : checkset.checks) for (const Check &check : checkset.checks)
qDebug() << check; qCDebug(lcDumpers) << check;
ok = false; ok = false;
} }
} }
@@ -2023,23 +2026,23 @@ void tst_Dumpers::dumper()
} }
if (!data.checks.isEmpty()) { if (!data.checks.isEmpty()) {
qDebug() << "SOME TESTS NOT EXECUTED: "; qCDebug(lcDumpers) << "SOME TESTS NOT EXECUTED: ";
for (const Check &check : qAsConst(data.checks)) { for (const Check &check : qAsConst(data.checks)) {
if (check.optionallyPresent) { if (check.optionallyPresent) {
qDebug() << " OPTIONAL TEST NOT FOUND: " << check << " IGNORED."; qCDebug(lcDumpers) << " OPTIONAL TEST NOT FOUND: " << check << " IGNORED.";
} else { } else {
qDebug() << " COMPULSORY TEST NOT FOUND: " << check; qCDebug(lcDumpers) << " COMPULSORY TEST NOT FOUND: " << check;
ok = false; ok = false;
} }
} }
qDebug() << "SEEN INAMES " << seenINames; qCDebug(lcDumpers) << "SEEN INAMES " << seenINames;
qDebug() << "EXPANDED : " << expanded; qCDebug(lcDumpers) << "EXPANDED : " << expanded;
} }
for (int i = data.requiredMessages.size(); --i >= 0; ) { for (int i = data.requiredMessages.size(); --i >= 0; ) {
RequiredMessage check = data.requiredMessages.at(i); RequiredMessage check = data.requiredMessages.at(i);
if (fullOutput.contains(check.message.toLatin1())) { if (fullOutput.contains(check.message.toLatin1())) {
qDebug() << " EXPECTED MESSAGE TO BE MISSING, BUT FOUND: " << check.message; qCDebug(lcDumpers) << " EXPECTED MESSAGE TO BE MISSING, BUT FOUND: " << check.message;
ok = false; ok = false;
} }
} }
@@ -2047,7 +2050,7 @@ void tst_Dumpers::dumper()
if (ok) { if (ok) {
m_keepTemp = false; m_keepTemp = false;
} else { } else {
local.forAllChildren([](WatchItem *item) { qDebug() << item->internalName(); }); local.forAllChildren([](WatchItem *item) { qCDebug(lcDumpers) << item->internalName(); });
int pos1 = 0, pos2 = -1; int pos1 = 0, pos2 = -1;
while (true) { while (true) {
@@ -2058,14 +2061,14 @@ void tst_Dumpers::dumper()
pos2 = fullOutput.indexOf("\"}", pos1 + 1); pos2 = fullOutput.indexOf("\"}", pos1 + 1);
if (pos2 == -1) if (pos2 == -1)
break; break;
qDebug() << "MSG: " << fullOutput.mid(pos1, pos2 - pos1 - 1); qCDebug(lcDumpers) << "MSG: " << fullOutput.mid(pos1, pos2 - pos1 - 1);
} }
qDebug().noquote() << "CONTENTS : " << contents; qCDebug(lcDumpers).noquote() << "CONTENTS : " << contents;
qDebug().noquote() << "FULL OUTPUT : " << fullOutput.data(); qCDebug(lcDumpers).noquote() << "FULL OUTPUT : " << fullOutput.data();
qDebug() << "Qt VERSION : " << QString::number(context.qtVersion, 16); qCDebug(lcDumpers) << "Qt VERSION : " << QString::number(context.qtVersion, 16);
if (m_debuggerEngine != CdbEngine) if (m_debuggerEngine != CdbEngine)
qDebug() << "GCC VERSION : " << context.gccVersion; qCDebug(lcDumpers) << "GCC VERSION : " << context.gccVersion;
qDebug() << "BUILD DIR : " << t->buildPath; qCDebug(lcDumpers) << "BUILD DIR : " << t->buildPath;
} }
QVERIFY(ok); QVERIFY(ok);
disarm(); disarm();