forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.8' into HEAD
Conflicts: src/libs/cplusplus/FindUsages.cpp tests/auto/cplusplus/findusages/tst_findusages.cpp tests/auto/debugger/tst_dumpers.cpp Change-Id: I20e2002c7b25cc25d8120922fa9b52e59db498e3
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import qbs.base 1.0
|
import qbs.base 1.0
|
||||||
|
import qbs.TextFile
|
||||||
import qbs.fileinfo as FileInfo
|
import qbs.fileinfo as FileInfo
|
||||||
|
|
||||||
Module {
|
Module {
|
||||||
|
|||||||
@@ -1102,7 +1102,6 @@ class Dumper:
|
|||||||
# Normal value
|
# Normal value
|
||||||
#numchild = 1 if value.MightHaveChildren() else 0
|
#numchild = 1 if value.MightHaveChildren() else 0
|
||||||
numchild = value.GetNumChildren()
|
numchild = value.GetNumChildren()
|
||||||
self.put('iname="%s",' % self.currentIName)
|
|
||||||
self.putType(typeName)
|
self.putType(typeName)
|
||||||
if typeClass == lldb.eTypeClassStruct or typeClass == lldb.eTypeClassClass:
|
if typeClass == lldb.eTypeClassStruct or typeClass == lldb.eTypeClassClass:
|
||||||
if self.isQObject(value):
|
if self.isQObject(value):
|
||||||
@@ -1129,7 +1128,7 @@ class Dumper:
|
|||||||
if value.GetType().GetTypeClass() == lldb.eTypeClassArray:
|
if value.GetType().GetTypeClass() == lldb.eTypeClassArray:
|
||||||
for i in xrange(value.GetNumChildren()):
|
for i in xrange(value.GetNumChildren()):
|
||||||
child = value.GetChildAtIndex(i)
|
child = value.GetChildAtIndex(i)
|
||||||
with UnnamedSubItem(self, "%d" % (i + 1)):
|
with UnnamedSubItem(self, str(i)):
|
||||||
self.putItem(child)
|
self.putItem(child)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -1156,7 +1155,7 @@ class Dumper:
|
|||||||
frame = self.currentThread().GetSelectedFrame()
|
frame = self.currentThread().GetSelectedFrame()
|
||||||
self.currentIName = 'local'
|
self.currentIName = 'local'
|
||||||
self.put('data=[')
|
self.put('data=[')
|
||||||
self.anonNumber = -1
|
self.anonNumber = 0
|
||||||
for value in frame.GetVariables(True, True, False, False):
|
for value in frame.GetVariables(True, True, False, False):
|
||||||
if self.dummyValue is None:
|
if self.dummyValue is None:
|
||||||
self.dummyValue = value
|
self.dummyValue = value
|
||||||
|
|||||||
@@ -2452,6 +2452,24 @@ def qdump__std__shared_ptr(d, value):
|
|||||||
d.putIntItem("usecount", refcount["_M_use_count"])
|
d.putIntItem("usecount", refcount["_M_use_count"])
|
||||||
d.putIntItem("weakcount", refcount["_M_weak_count"])
|
d.putIntItem("weakcount", refcount["_M_weak_count"])
|
||||||
|
|
||||||
|
def qdump__std____1__shared_ptr(d, value):
|
||||||
|
i = value["__ptr_"]
|
||||||
|
if isNull(i):
|
||||||
|
d.putValue("(null)")
|
||||||
|
d.putNumChild(0)
|
||||||
|
return
|
||||||
|
|
||||||
|
if isSimpleType(d.templateArgument(value.type, 0)):
|
||||||
|
d.putValue("%s @0x%x" % (i.dereference().value, pointerValue(i)))
|
||||||
|
else:
|
||||||
|
d.putValue("@0x%x" % pointerValue(i))
|
||||||
|
|
||||||
|
d.putNumChild(3)
|
||||||
|
with Children(d, 3):
|
||||||
|
d.putSubItem("data", i.dereference())
|
||||||
|
d.putFields(value["__cntrl_"].dereference())
|
||||||
|
#d.putIntItem("usecount", refcount["_M_use_count"])
|
||||||
|
#d.putIntItem("weakcount", refcount["_M_weak_count"])
|
||||||
|
|
||||||
def qdump__std__unique_ptr(d, value):
|
def qdump__std__unique_ptr(d, value):
|
||||||
i = value["_M_t"]["_M_head_impl"]
|
i = value["_M_t"]["_M_head_impl"]
|
||||||
@@ -2470,6 +2488,23 @@ def qdump__std__unique_ptr(d, value):
|
|||||||
with Children(d, 1):
|
with Children(d, 1):
|
||||||
d.putSubItem("data", i)
|
d.putSubItem("data", i)
|
||||||
|
|
||||||
|
def qdump__std____1__unique_ptr(d, value):
|
||||||
|
i = childAt(childAt(value["__ptr_"], 0), 0)
|
||||||
|
if isNull(i):
|
||||||
|
d.putValue("(null)")
|
||||||
|
d.putNumChild(0)
|
||||||
|
return
|
||||||
|
|
||||||
|
if isSimpleType(d.templateArgument(value.type, 0)):
|
||||||
|
d.putValue("%s @0x%x" % (i.dereference().value, pointerValue(i)))
|
||||||
|
else:
|
||||||
|
d.putValue("@0x%x" % pointerValue(i))
|
||||||
|
|
||||||
|
d.putNumChild(1)
|
||||||
|
with Children(d, 1):
|
||||||
|
d.putSubItem("data", i.dereference())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def qedit__std__vector(expr, value):
|
def qedit__std__vector(expr, value):
|
||||||
values = value.split(',')
|
values = value.split(',')
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import qbs
|
import qbs
|
||||||
|
import qbs.TextFile
|
||||||
|
|
||||||
Product {
|
Product {
|
||||||
name: "app_version_header"
|
name: "app_version_header"
|
||||||
|
|||||||
@@ -233,7 +233,15 @@ bool FindUsages::checkCandidates(const QList<LookupItem> &candidates) const
|
|||||||
if (scopeOfTemplEnclosingCandidateSymbol != scopeOfTemplEnclosingDeclSymbol)
|
if (scopeOfTemplEnclosingCandidateSymbol != scopeOfTemplEnclosingDeclSymbol)
|
||||||
return false;
|
return false;
|
||||||
} else if (s->enclosingScope()->isTemplate() && ! _declSymbol->isTypenameArgument()) {
|
} else if (s->enclosingScope()->isTemplate() && ! _declSymbol->isTypenameArgument()) {
|
||||||
if (s->enclosingScope()->enclosingScope() != _declSymbol->enclosingScope())
|
if (_declSymbol->enclosingScope()->isTemplate()) {
|
||||||
|
if (s->enclosingScope()->enclosingScope() != _declSymbol->enclosingScope()->enclosingScope())
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
if (s->enclosingScope()->enclosingScope() != _declSymbol->enclosingScope())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (_declSymbol->enclosingScope()->isTemplate() && s->isTemplate()) {
|
||||||
|
if (_declSymbol->enclosingScope()->enclosingScope() != s->enclosingScope())
|
||||||
return false;
|
return false;
|
||||||
} else if (! s->isUsingDeclaration()
|
} else if (! s->isUsingDeclaration()
|
||||||
&& s->enclosingScope() != _declSymbol->enclosingScope()) {
|
&& s->enclosingScope() != _declSymbol->enclosingScope()) {
|
||||||
|
|||||||
@@ -485,7 +485,7 @@ void QbsProductNode::setQbsProductData(const qbs::ProductData prd)
|
|||||||
if (m_qbsProductData == prd)
|
if (m_qbsProductData == prd)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool productWasEnabled = m_qbsProductData.isEnabled();
|
bool productWasEnabled = m_qbsProductData.isValid() && m_qbsProductData.isEnabled();
|
||||||
bool productIsEnabled = prd.isEnabled();
|
bool productIsEnabled = prd.isEnabled();
|
||||||
bool updateExisting = productWasEnabled != productIsEnabled;
|
bool updateExisting = productWasEnabled != productIsEnabled;
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
namespace QbsProjectManager {
|
namespace QbsProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QBSPROJECTMANAGER_EXPORT QbsParser : public ProjectExplorer::IOutputParser
|
class QbsParser : public ProjectExplorer::IOutputParser
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class QbsProject;
|
|||||||
class QbsProjectManagerPlugin;
|
class QbsProjectManagerPlugin;
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
class QBSPROJECTMANAGER_EXPORT QbsManager : public ProjectExplorer::IProjectManager
|
class QbsManager : public ProjectExplorer::IProjectManager
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ QString QbsRunConfiguration::executable() const
|
|||||||
QbsProject *pro = static_cast<QbsProject *>(target()->project());
|
QbsProject *pro = static_cast<QbsProject *>(target()->project());
|
||||||
const qbs::ProductData product = findProduct(pro->qbsProjectData(), m_qbsProduct);
|
const qbs::ProductData product = findProduct(pro->qbsProjectData(), m_qbsProduct);
|
||||||
|
|
||||||
if (product.isValid() || !pro->qbsProject())
|
if (!product.isValid() || !pro->qbsProject())
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
return pro->qbsProject()->targetExecutable(product, installOptions());
|
return pro->qbsProject()->targetExecutable(product, installOptions());
|
||||||
@@ -518,7 +518,7 @@ bool QbsRunConfigurationFactory::canCreate(ProjectExplorer::Target *parent, cons
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
QbsProject *project = static_cast<QbsProject *>(parent->project());
|
QbsProject *project = static_cast<QbsProject *>(parent->project());
|
||||||
return !findProduct(project->qbsProjectData(), productFromId(id)).isValid();
|
return findProduct(project->qbsProjectData(), productFromId(id)).isValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::RunConfiguration *QbsRunConfigurationFactory::doCreate(ProjectExplorer::Target *parent, const Core::Id id)
|
ProjectExplorer::RunConfiguration *QbsRunConfigurationFactory::doCreate(ProjectExplorer::Target *parent, const Core::Id id)
|
||||||
|
|||||||
Submodule src/shared/qbs updated: 604aa765a8...6e432eef92
@@ -104,6 +104,7 @@ private Q_SLOTS:
|
|||||||
void using_insideGlobalNamespace();
|
void using_insideGlobalNamespace();
|
||||||
void using_insideNamespace();
|
void using_insideNamespace();
|
||||||
void using_insideFunction();
|
void using_insideFunction();
|
||||||
|
void templatedFunction_QTCREATORBUG9749();
|
||||||
};
|
};
|
||||||
|
|
||||||
void tst_FindUsages::inlineMethod()
|
void tst_FindUsages::inlineMethod()
|
||||||
@@ -818,5 +819,35 @@ void tst_FindUsages::templateFunctionParameters()
|
|||||||
QCOMPARE(findUsages.usages().size(), 4);
|
QCOMPARE(findUsages.usages().size(), 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_FindUsages::templatedFunction_QTCREATORBUG9749()
|
||||||
|
{
|
||||||
|
const QByteArray src = "\n"
|
||||||
|
"template <class IntType> char *reformatInteger(IntType value, int format) {}\n"
|
||||||
|
"void func(int code, int format) {\n"
|
||||||
|
" reformatInteger(code, format);"
|
||||||
|
"}\n"
|
||||||
|
;
|
||||||
|
|
||||||
|
Document::Ptr doc = Document::create("templatedFunction_QTCREATORBUG9749");
|
||||||
|
doc->setUtf8Source(src);
|
||||||
|
doc->parse();
|
||||||
|
doc->check();
|
||||||
|
|
||||||
|
QVERIFY(doc->diagnosticMessages().isEmpty());
|
||||||
|
QCOMPARE(doc->globalSymbolCount(), 2U);
|
||||||
|
|
||||||
|
Snapshot snapshot;
|
||||||
|
snapshot.insert(doc);
|
||||||
|
|
||||||
|
Template *funcTempl = doc->globalSymbolAt(0)->asTemplate();
|
||||||
|
QVERIFY(funcTempl);
|
||||||
|
QCOMPARE(funcTempl->memberCount(), 2U);
|
||||||
|
Function *func = funcTempl->memberAt(1)->asFunction();
|
||||||
|
|
||||||
|
FindUsages findUsages(src, doc, snapshot);
|
||||||
|
findUsages(func);
|
||||||
|
QCOMPARE(findUsages.usages().size(), 2);
|
||||||
|
}
|
||||||
|
|
||||||
QTEST_APPLESS_MAIN(tst_FindUsages)
|
QTEST_APPLESS_MAIN(tst_FindUsages)
|
||||||
#include "tst_findusages.moc"
|
#include "tst_findusages.moc"
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include "temporarydir.h"
|
#include "temporarydir.h"
|
||||||
|
|
||||||
#include <QtTest>
|
#include <QtTest>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
#if QT_VERSION >= 0x050000
|
||||||
#define MSKIP_SINGLE(x) QSKIP(x)
|
#define MSKIP_SINGLE(x) QSKIP(x)
|
||||||
@@ -195,9 +196,10 @@ static QByteArray parentIName(const QByteArray &iname)
|
|||||||
|
|
||||||
struct ValueBase
|
struct ValueBase
|
||||||
{
|
{
|
||||||
ValueBase() : hasPtrSuffix(false), version(0) {}
|
ValueBase() : hasPtrSuffix(false), isFloatValue(false), version(0) {}
|
||||||
|
|
||||||
bool hasPtrSuffix;
|
bool hasPtrSuffix;
|
||||||
|
bool isFloatValue;
|
||||||
int version;
|
int version;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -235,6 +237,18 @@ struct Value : public ValueBase
|
|||||||
if (hasPtrSuffix)
|
if (hasPtrSuffix)
|
||||||
return actualValue.startsWith(expectedValue + QLatin1String(" @0x"))
|
return actualValue.startsWith(expectedValue + QLatin1String(" @0x"))
|
||||||
|| actualValue.startsWith(expectedValue + QLatin1String("@0x"));
|
|| actualValue.startsWith(expectedValue + QLatin1String("@0x"));
|
||||||
|
|
||||||
|
if (isFloatValue) {
|
||||||
|
double f1 = fabs(expectedValue.toDouble());
|
||||||
|
double f2 = fabs(actualValue.toDouble());
|
||||||
|
//qDebug() << "expected float: " << qPrintable(expectedValue) << f1;
|
||||||
|
//qDebug() << "actual float: " << qPrintable(actualValue) << f2;
|
||||||
|
if (f1 < f2)
|
||||||
|
std::swap(f1, f2);
|
||||||
|
return f1 - f2 <= 0.01 * f2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return actualValue == expectedValue;
|
return actualValue == expectedValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,6 +261,12 @@ struct Pointer : Value
|
|||||||
Pointer(const QByteArray &value) : Value(value) { hasPtrSuffix = true; }
|
Pointer(const QByteArray &value) : Value(value) { hasPtrSuffix = true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct FloatValue : Value
|
||||||
|
{
|
||||||
|
FloatValue() { isFloatValue = true; }
|
||||||
|
FloatValue(const QByteArray &value) : Value(value) { isFloatValue = true; }
|
||||||
|
};
|
||||||
|
|
||||||
struct Value4 : Value
|
struct Value4 : Value
|
||||||
{
|
{
|
||||||
Value4(const QByteArray &value) : Value(value) { version = 4; }
|
Value4(const QByteArray &value) : Value(value) { version = 4; }
|
||||||
@@ -311,15 +331,6 @@ struct CheckType : public Check
|
|||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CheckPlain : public Check
|
|
||||||
{
|
|
||||||
CheckPlain(const QByteArray &iname, const Name &name,
|
|
||||||
const Type &type)
|
|
||||||
: Check(iname, name, noValue, type)
|
|
||||||
{}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Profile
|
struct Profile
|
||||||
{
|
{
|
||||||
Profile(const QByteArray &contents) : contents(contents) {}
|
Profile(const QByteArray &contents) : contents(contents) {}
|
||||||
@@ -336,9 +347,9 @@ struct Cxx11Profile : public Profile
|
|||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MacLibStdCppProfile : public Profile
|
struct MacLibCppProfile : public Profile
|
||||||
{
|
{
|
||||||
MacLibStdCppProfile()
|
MacLibCppProfile()
|
||||||
: Profile("macx {\n"
|
: Profile("macx {\n"
|
||||||
"QMAKE_CXXFLAGS += -stdlib=libc++\n"
|
"QMAKE_CXXFLAGS += -stdlib=libc++\n"
|
||||||
"LIBS += -stdlib=libc++\n"
|
"LIBS += -stdlib=libc++\n"
|
||||||
@@ -401,9 +412,13 @@ struct GuiProfile {};
|
|||||||
|
|
||||||
struct DataBase
|
struct DataBase
|
||||||
{
|
{
|
||||||
DataBase() : useQt(false), forceC(false), gdbOnly(false), lldbOnly(false) {}
|
DataBase()
|
||||||
|
: useQt(false), useQHash(false),
|
||||||
|
forceC(false), gdbOnly(false), lldbOnly(false)
|
||||||
|
{}
|
||||||
|
|
||||||
mutable bool useQt;
|
mutable bool useQt;
|
||||||
|
mutable bool useQHash;
|
||||||
mutable bool forceC;
|
mutable bool forceC;
|
||||||
mutable bool gdbOnly;
|
mutable bool gdbOnly;
|
||||||
mutable bool lldbOnly;
|
mutable bool lldbOnly;
|
||||||
@@ -461,34 +476,33 @@ public:
|
|||||||
{
|
{
|
||||||
profileExtra +=
|
profileExtra +=
|
||||||
"CONFIG += QT\n"
|
"CONFIG += QT\n"
|
||||||
"QT += gui\n"
|
"QT += core\n";
|
||||||
"greaterThan(QT_MAJOR_VERSION, 4):QT *= widgets\n";
|
|
||||||
|
|
||||||
useQt = true;
|
useQt = true;
|
||||||
|
useQHash = true;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Data &operator%(const GuiProfile &) const
|
const Data &operator%(const GuiProfile &) const
|
||||||
{
|
{
|
||||||
|
this->operator%(CoreProfile());
|
||||||
profileExtra +=
|
profileExtra +=
|
||||||
"CONFIG += QT\n"
|
|
||||||
"QT += gui\n"
|
"QT += gui\n"
|
||||||
"greaterThan(QT_MAJOR_VERSION, 4):QT *= widgets\n";
|
"greaterThan(QT_MAJOR_VERSION, 4):QT *= widgets\n";
|
||||||
|
|
||||||
useQt = true;
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Data &operator%(const CorePrivateProfile &) const
|
const Data &operator%(const CorePrivateProfile &) const
|
||||||
{
|
{
|
||||||
|
this->operator%(CoreProfile());
|
||||||
profileExtra +=
|
profileExtra +=
|
||||||
"CONFIG += QT\n"
|
|
||||||
"greaterThan(QT_MAJOR_VERSION, 4) {\n"
|
"greaterThan(QT_MAJOR_VERSION, 4) {\n"
|
||||||
" QT += core core-private\n"
|
" QT += core-private\n"
|
||||||
" CONFIG += no_private_qt_headers_warning\n"
|
" CONFIG += no_private_qt_headers_warning\n"
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
useQt = true;
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,8 +514,8 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
mutable QByteArray profileExtra;
|
mutable QByteArray profileExtra;
|
||||||
QByteArray includes;
|
mutable QByteArray includes;
|
||||||
QByteArray code;
|
mutable QByteArray code;
|
||||||
mutable QMap<QByteArray, Check> checks; // IName -> Action
|
mutable QMap<QByteArray, Check> checks; // IName -> Action
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -586,7 +600,6 @@ void tst_Dumpers::initTestCase()
|
|||||||
qDebug() << "QMake : " << m_qmakeBinary.constData();
|
qDebug() << "QMake : " << m_qmakeBinary.constData();
|
||||||
|
|
||||||
Environment utilsEnv = Environment::systemEnvironment();
|
Environment utilsEnv = Environment::systemEnvironment();
|
||||||
utilsEnv.appendOrSet(QLatin1String("QT_HASH_SEED"), QLatin1String("0"));
|
|
||||||
|
|
||||||
if (m_debuggerEngine == DumpTestGdbEngine) {
|
if (m_debuggerEngine == DumpTestGdbEngine) {
|
||||||
QProcess debugger;
|
QProcess debugger;
|
||||||
@@ -717,9 +730,20 @@ void tst_Dumpers::dumper()
|
|||||||
"\n\nvoid unused(const void *first,...) { (void) first; }"
|
"\n\nvoid unused(const void *first,...) { (void) first; }"
|
||||||
"\n\nvoid breakHere() {}"
|
"\n\nvoid breakHere() {}"
|
||||||
"\n\n" + data.includes +
|
"\n\n" + data.includes +
|
||||||
|
"\n\n" + (data.useQHash ?
|
||||||
|
"\n#include <QByteArray>"
|
||||||
|
"\n#if QT_VERSION >= 0x050000"
|
||||||
|
"\nQT_BEGIN_NAMESPACE"
|
||||||
|
"\nQ_CORE_EXPORT extern QBasicAtomicInt qt_qhash_seed; // from qhash.cpp"
|
||||||
|
"\nQT_END_NAMESPACE"
|
||||||
|
"\n#endif" : "") +
|
||||||
"\n\nint main(int argc, char *argv[])"
|
"\n\nint main(int argc, char *argv[])"
|
||||||
"\n{"
|
"\n{"
|
||||||
"\n int qtversion = " + (data.useQt ? "QT_VERSION" : "0") + ";\n"
|
"\n int qtversion = " + (data.useQt ? "QT_VERSION" : "0") + ";"
|
||||||
|
"\n" + (data.useQHash ?
|
||||||
|
"\n#if QT_VERSION >= 0x050000"
|
||||||
|
"\nqt_qhash_seed.testAndSetRelaxed(-1, 0);"
|
||||||
|
"\n#endif\n" : "") +
|
||||||
"\n unused(&argc, &argv, &qtversion);\n"
|
"\n unused(&argc, &argv, &qtversion);\n"
|
||||||
"\n" + data.code +
|
"\n" + data.code +
|
||||||
"\n breakHere();"
|
"\n breakHere();"
|
||||||
@@ -1033,16 +1057,17 @@ void tst_Dumpers::dumper_data()
|
|||||||
" } // namespace nsB\n"
|
" } // namespace nsB\n"
|
||||||
" } // namespace nsA\n";
|
" } // namespace nsA\n";
|
||||||
|
|
||||||
QTest::newRow("AnonymousStruct")
|
QTest::newRow("AnonymousStructGdb")
|
||||||
<< Data("union {\n"
|
<< Data("union {\n"
|
||||||
" struct { int i; int b; };\n"
|
" struct { int i; int b; };\n"
|
||||||
" struct { float f; };\n"
|
" struct { float f; };\n"
|
||||||
" double d;\n"
|
" double d;\n"
|
||||||
" } a = { { 42, 43 } };\n (void)a;")
|
" } a = { { 42, 43 } };\n (void)a;")
|
||||||
|
% GdbOnly()
|
||||||
% CheckType("a", "a", "union {...}")
|
% CheckType("a", "a", "union {...}")
|
||||||
% Check("a.b", "43", "int")
|
% Check("a.b", "43", "int")
|
||||||
% Check("a.d", "9.1245819032257467e-313", "double")
|
% Check("a.d", FloatValue("9.1245819032257467e-313"), "double")
|
||||||
% Check("a.f", "5.88545355e-44", "float")
|
% Check("a.f", FloatValue("5.88545355e-44"), "float")
|
||||||
% Check("a.i", "42", "int");
|
% Check("a.i", "42", "int");
|
||||||
|
|
||||||
QTest::newRow("QByteArrayData")
|
QTest::newRow("QByteArrayData")
|
||||||
@@ -1052,6 +1077,20 @@ void tst_Dumpers::dumper_data()
|
|||||||
% Check("ba", Value4(""), "@QByteArrayData")
|
% Check("ba", Value4(""), "@QByteArrayData")
|
||||||
% Check("ba", Value5(""), "@QByteArrayData");
|
% Check("ba", Value5(""), "@QByteArrayData");
|
||||||
|
|
||||||
|
// FIXME: Merge with GDB case
|
||||||
|
QTest::newRow("AnonymousStructLldb")
|
||||||
|
<< Data("union {\n"
|
||||||
|
" struct { int i; int b; };\n"
|
||||||
|
" struct { float f; };\n"
|
||||||
|
" double d;\n"
|
||||||
|
" } a = { { 42, 43 } };\n (void)a;")
|
||||||
|
//% CheckType("a", "a", "union {...}")
|
||||||
|
% LldbOnly()
|
||||||
|
% Check("a.#1.b", "43", "int")
|
||||||
|
% Check("a.d", FloatValue("9.1245819032257467e-313"), "double")
|
||||||
|
% Check("a.#2.f", FloatValue("5.88545355e-44"), "float")
|
||||||
|
% Check("a.#1.i", "42", "int");
|
||||||
|
|
||||||
QTest::newRow("QByteArray0")
|
QTest::newRow("QByteArray0")
|
||||||
<< Data("#include <QByteArray>\n",
|
<< Data("#include <QByteArray>\n",
|
||||||
"QByteArray ba;")
|
"QByteArray ba;")
|
||||||
@@ -2347,7 +2386,7 @@ void tst_Dumpers::dumper_data()
|
|||||||
"unused(&a, &b);\n")
|
"unused(&a, &b);\n")
|
||||||
% CoreProfile()
|
% CoreProfile()
|
||||||
% Cxx11Profile()
|
% Cxx11Profile()
|
||||||
% MacLibStdCppProfile()
|
% MacLibCppProfile()
|
||||||
% Check("a", "<4 items>", "std::array<int, 4u>")
|
% Check("a", "<4 items>", "std::array<int, 4u>")
|
||||||
% Check("b", "<4 items>", "std::array<@QString, 4u>");
|
% Check("b", "<4 items>", "std::array<@QString, 4u>");
|
||||||
|
|
||||||
@@ -2356,16 +2395,28 @@ void tst_Dumpers::dumper_data()
|
|||||||
"std::complex<double> c(1, 2);\n")
|
"std::complex<double> c(1, 2);\n")
|
||||||
% Check("c", "(1.000000, 2.000000)", "std::complex<double>");
|
% Check("c", "(1.000000, 2.000000)", "std::complex<double>");
|
||||||
|
|
||||||
QTest::newRow("CComplex")
|
QTest::newRow("CComplexGdb")
|
||||||
<< Data("#include <complex.h>\n",
|
<< Data("#include <complex.h>\n",
|
||||||
"// Doesn't work when compiled as C++.\n"
|
"// Doesn't work when compiled as C++.\n"
|
||||||
"double complex a = 0;\n"
|
"double complex a = 0;\n"
|
||||||
"double _Complex b = 0;\n"
|
"double _Complex b = 0;\n"
|
||||||
"unused(&a, &b);\n")
|
"unused(&a, &b);\n")
|
||||||
% ForceC()
|
% ForceC()
|
||||||
|
% GdbOnly()
|
||||||
% Check("a", "0 + 0 * I", "complex double")
|
% Check("a", "0 + 0 * I", "complex double")
|
||||||
% Check("b", "0 + 0 * I", "complex double");
|
% Check("b", "0 + 0 * I", "complex double");
|
||||||
|
|
||||||
|
QTest::newRow("CComplexLldb")
|
||||||
|
<< Data("#include <complex.h>\n",
|
||||||
|
"// Doesn't work when compiled as C++.\n"
|
||||||
|
"double complex a = 0;\n"
|
||||||
|
"double _Complex b = 0;\n"
|
||||||
|
"unused(&a, &b);\n")
|
||||||
|
% ForceC()
|
||||||
|
% LldbOnly()
|
||||||
|
% Check("a", "0 + 0i", "_Complex double")
|
||||||
|
% Check("b", "0 + 0i", "_Complex double");
|
||||||
|
|
||||||
QTest::newRow("StdDequeInt")
|
QTest::newRow("StdDequeInt")
|
||||||
<< Data("#include <deque>\n",
|
<< Data("#include <deque>\n",
|
||||||
"std::deque<int> deque;\n"
|
"std::deque<int> deque;\n"
|
||||||
@@ -2638,6 +2689,7 @@ void tst_Dumpers::dumper_data()
|
|||||||
"std::unique_ptr<int> pi(new int(32));\n"
|
"std::unique_ptr<int> pi(new int(32));\n"
|
||||||
"std::unique_ptr<Foo> pf(new Foo);\n")
|
"std::unique_ptr<Foo> pf(new Foo);\n")
|
||||||
% Cxx11Profile()
|
% Cxx11Profile()
|
||||||
|
% MacLibCppProfile()
|
||||||
% Check("pi", Pointer("32"), "std::unique_ptr<int, std::default_delete<int> >")
|
% Check("pi", Pointer("32"), "std::unique_ptr<int, std::default_delete<int> >")
|
||||||
% Check("pf", Pointer(), "std::unique_ptr<Foo, std::default_delete<Foo> >");
|
% Check("pf", Pointer(), "std::unique_ptr<Foo, std::default_delete<Foo> >");
|
||||||
|
|
||||||
@@ -2646,6 +2698,7 @@ void tst_Dumpers::dumper_data()
|
|||||||
"std::shared_ptr<int> pi(new int(32));\n"
|
"std::shared_ptr<int> pi(new int(32));\n"
|
||||||
"std::shared_ptr<Foo> pf(new Foo);\n")
|
"std::shared_ptr<Foo> pf(new Foo);\n")
|
||||||
% Cxx11Profile()
|
% Cxx11Profile()
|
||||||
|
% MacLibCppProfile()
|
||||||
% Check("pi", Pointer("32"), "std::shared_ptr<int>")
|
% Check("pi", Pointer("32"), "std::shared_ptr<int>")
|
||||||
% Check("pf", Pointer(), "std::shared_ptr<Foo>");
|
% Check("pf", Pointer(), "std::shared_ptr<Foo>");
|
||||||
|
|
||||||
|
|||||||
@@ -642,10 +642,11 @@ def checkIfObjectExists(name, shouldExist = True, timeout = 3000, verboseOnFail
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
# wait for progress bar(s) to appear and disappear
|
# wait for progress bar(s) to appear and disappear
|
||||||
def progressBarWait(timeout=60000):
|
def progressBarWait(timeout=60000, warn=True):
|
||||||
if not checkIfObjectExists(":Qt Creator_Core::Internal::ProgressBar", True, 6000):
|
if not checkIfObjectExists(":Qt Creator_Core::Internal::ProgressBar", True, 6000):
|
||||||
test.warning("progressBarWait() timed out when waiting for ProgressBar.",
|
if warn:
|
||||||
"This may lead to unforeseen behavior. Consider increasing the timeout.")
|
test.warning("progressBarWait() timed out when waiting for ProgressBar.",
|
||||||
|
"This may lead to unforeseen behavior. Consider increasing the timeout.")
|
||||||
checkIfObjectExists(":Qt Creator_Core::Internal::ProgressBar", False, timeout)
|
checkIfObjectExists(":Qt Creator_Core::Internal::ProgressBar", False, timeout)
|
||||||
|
|
||||||
def readFile(filename):
|
def readFile(filename):
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ def main():
|
|||||||
mouseClick(waitForObject(":Qt Creator.Help_Search for:_QLineEdit"))
|
mouseClick(waitForObject(":Qt Creator.Help_Search for:_QLineEdit"))
|
||||||
replaceEditorContent(":Qt Creator.Help_Search for:_QLineEdit", searchKeyword)
|
replaceEditorContent(":Qt Creator.Help_Search for:_QLineEdit", searchKeyword)
|
||||||
type(waitForObject(":Qt Creator.Help_Search for:_QLineEdit"), "<Return>")
|
type(waitForObject(":Qt Creator.Help_Search for:_QLineEdit"), "<Return>")
|
||||||
progressBarWait()
|
progressBarWait(warn=False)
|
||||||
if shouldFind:
|
if shouldFind:
|
||||||
test.verify(waitFor("re.match('[1-9]\d* - [1-9]\d* of [1-9]\d* Hits',"
|
test.verify(waitFor("re.match('[1-9]\d* - [1-9]\d* of [1-9]\d* Hits',"
|
||||||
"str(findObject(':Hits_QLabel').text))", 2000),
|
"str(findObject(':Hits_QLabel').text))", 2000),
|
||||||
@@ -129,7 +129,7 @@ def main():
|
|||||||
# advanced search - do search
|
# advanced search - do search
|
||||||
clickButton(waitForObject("{text='Search' type='QPushButton' unnamed='1' visible='1' "
|
clickButton(waitForObject("{text='Search' type='QPushButton' unnamed='1' visible='1' "
|
||||||
"window=':Qt Creator_Core::Internal::MainWindow'}"))
|
"window=':Qt Creator_Core::Internal::MainWindow'}"))
|
||||||
progressBarWait()
|
progressBarWait(warn=False)
|
||||||
# verify that advanced search results found
|
# verify that advanced search results found
|
||||||
test.verify(waitFor("re.search('1 - 2 of 2 Hits',"
|
test.verify(waitFor("re.search('1 - 2 of 2 Hits',"
|
||||||
"str(findObject(':Hits_QLabel').text))", 3000),
|
"str(findObject(':Hits_QLabel').text))", 3000),
|
||||||
|
|||||||
Reference in New Issue
Block a user