aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2014-03-31 11:23:45 +0200
committerJoerg Bornemann <joerg.bornemann@digia.com>2014-03-31 11:59:50 +0200
commitd74004353467f47a2bc4417bdfd277a1cd26c780 (patch)
treecf9d0a01720e7e94bc90dec5c2562da072caace4 /tests/auto/blackbox
parenta27c3eec3345dff11ba1f67ff7b060eaef7a8090 (diff)
Fix QML debugging for Qt 5.
The line enabling the respective C++ macro got lost when we switched to the new Qt module approach. (And the name of the macro was wrong for Qt 5 anyway, so it hadn't worked before either.) Also add an autotest to catch things like macro renaming in the future. Task-number: QTCREATORBUG-11914 Change-Id: Ica188c20e99c204d1a9d4e5f285a938707d997dd Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tests/auto/blackbox')
-rw-r--r--tests/auto/blackbox/testdata/qml-debugging/main.cpp12
-rw-r--r--tests/auto/blackbox/testdata/qml-debugging/project.qbs9
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp15
-rw-r--r--tests/auto/blackbox/tst_blackbox.h1
4 files changed, 37 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/qml-debugging/main.cpp b/tests/auto/blackbox/testdata/qml-debugging/main.cpp
new file mode 100644
index 000000000..51f46ef65
--- /dev/null
+++ b/tests/auto/blackbox/testdata/qml-debugging/main.cpp
@@ -0,0 +1,12 @@
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ QQmlApplicationEngine engine;
+ engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml")));
+
+ return app.exec();
+}
diff --git a/tests/auto/blackbox/testdata/qml-debugging/project.qbs b/tests/auto/blackbox/testdata/qml-debugging/project.qbs
new file mode 100644
index 000000000..690bf40f9
--- /dev/null
+++ b/tests/auto/blackbox/testdata/qml-debugging/project.qbs
@@ -0,0 +1,9 @@
+import qbs
+
+CppApplication {
+ name: "debuggable-app"
+ type: "application"
+ Depends { name: "Qt.quick" }
+ Qt.quick.qmlDebugging: true
+ files: "main.cpp"
+}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index c106d5d16..c51505b70 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -1688,6 +1688,21 @@ void TestBlackbox::objC()
QCOMPARE(runQbs(), 0);
}
+void TestBlackbox::qmlDebugging()
+{
+ QDir::setCurrent(testDataDir + "/qml-debugging");
+ QCOMPARE(runQbs(), 0);
+ QProcess nm;
+ nm.start("nm", QStringList("-C")
+ << HostOsInfo::appendExecutableSuffix(buildDir + "/debuggable-app"));
+ if (nm.waitForStarted()) { // Let's ignore hosts without nm.
+ QVERIFY2(nm.waitForFinished(), qPrintable(nm.errorString()));
+ QVERIFY2(nm.exitCode() == 0, nm.readAllStandardError().constData());
+ const QByteArray output = nm.readAllStandardOutput();
+ QVERIFY2(output.contains("qQmlEnableDebuggingHelper"), output.constData());
+ }
+}
+
void TestBlackbox::properQuoting()
{
QDir::setCurrent(testDataDir + "/proper quoting");
diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h
index 41b48aa49..1efcb34b4 100644
--- a/tests/auto/blackbox/tst_blackbox.h
+++ b/tests/auto/blackbox/tst_blackbox.h
@@ -122,6 +122,7 @@ private slots:
void inheritQbsSearchPaths();
void mocCppIncluded();
void objC();
+ void qmlDebugging();
void properQuoting();
void propertiesBlocks();
void resolve_project_data();