summaryrefslogtreecommitdiff
path: root/tests/auto/debugger/tst_dumpers.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2017-05-23 23:41:14 +0300
committerOrgad Shaneh <orgad.shaneh@audiocodes.com>2017-05-23 23:41:40 +0300
commit8430da3bf7f495ecfe84b36421d4da801cf0f6a5 (patch)
tree805d10955fa65e635077038f5fb54bb0e0b168eb /tests/auto/debugger/tst_dumpers.cpp
parentd42e867f441f90bf127c3fc8571b862bb4a9596a (diff)
parent7482d8a15239ee1cb289953f7d8ce167583b6261 (diff)
downloadqt-creator-8430da3bf7f495ecfe84b36421d4da801cf0f6a5.tar.gz
Merge remote-tracking branch 'origin/4.3' into master
Change-Id: I01ab8c85ea3372b6dce4142ddb9cf92d903ffca6
Diffstat (limited to 'tests/auto/debugger/tst_dumpers.cpp')
-rw-r--r--tests/auto/debugger/tst_dumpers.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp
index a699586edb..1342e0c8e0 100644
--- a/tests/auto/debugger/tst_dumpers.cpp
+++ b/tests/auto/debugger/tst_dumpers.cpp
@@ -473,6 +473,13 @@ struct RequiredMessage
QString message;
};
+struct DumperOptions
+{
+ DumperOptions(const QString &opts = QString()) : options(opts) {}
+
+ QString options;
+};
+
struct Check
{
Check() {}
@@ -699,6 +706,12 @@ public:
return *this;
}
+ const Data &operator+(const DumperOptions &options) const
+ {
+ dumperOptions += options.options;
+ return *this;
+ }
+
const Data &operator+(const Profile &profile) const
{
profileExtra += profile.contents;
@@ -921,6 +934,7 @@ public:
mutable QString mainFile = "main.cpp";
mutable QString projectFile = "doit.pro";
+ mutable QString dumperOptions;
mutable QString profileExtra;
mutable QString includes;
mutable QString code;
@@ -1442,6 +1456,10 @@ void tst_Dumpers::dumper()
QStringList args;
QString cmds;
+ QString dumperOptions = data.dumperOptions;
+ if (!dumperOptions.isEmpty() && !dumperOptions.endsWith(','))
+ dumperOptions += ',';
+
if (m_debuggerEngine == GdbEngine) {
const QFileInfo gdbBinaryFile(exe);
const QString uninstalledData = gdbBinaryFile.absolutePath()
@@ -1465,7 +1483,7 @@ void tst_Dumpers::dumper()
"python theDumper.setupDumpers()\n"
"run " + nograb + "\n"
"up " + QString::number(data.skipLevels) + "\n"
- "python theDumper.fetchVariables({"
+ "python theDumper.fetchVariables({" + dumperOptions +
"'token':2,'fancy':1,'forcens':1,"
"'autoderef':1,'dyntype':1,'passexceptions':1,"
"'testing':1,'qobjectnames':1,"
@@ -5320,6 +5338,18 @@ void tst_Dumpers::dumper_data()
+ Check("a2.3", "[3]", "100", "char");
+ QTest::newRow("Array10Format")
+ << Data("",
+ "int arr[4] = { 1, 2, 3, 4};\n"
+ "int *nums = new int[4] { 1, 2, 3, 4};\n")
+
+ + NoLldbEngine // FIXME: DumperOptions not handled yet.
+ + DumperOptions("'formats':{'local.nums':12}") // Array10Format
+
+ + Check("arr.1", "[1]", "2", "int")
+ + Check("nums.1", "[1]", "2", "int");
+
+
QTest::newRow("ArrayQt")
<< Data("#include <QByteArray>\n"
"#include <QString>\n" + fooData,