diff options
author | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-03-17 11:53:59 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-03-17 11:54:06 +0100 |
commit | 8b6098d7b5a3ca4407071dc0d692aa17f88fba47 (patch) | |
tree | 364d370c820b7776c257c525ea2b01a466ae8bfd /tests | |
parent | e23402879f3d68243ed8f708b06a96416c980d6a (diff) | |
parent | 45b05a4a4a9cd04a58279089b69ed23e83f82b70 (diff) |
Merge remote-tracking branch 'origin/2.0'
Change-Id: I3b38821be20c02d41d9db1c5eee78be1502cba6b
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/installer/scriptengine/tst_scriptengine.cpp | 16 | ||||
-rw-r--r-- | tests/auto/installer/solver/tst_solver.cpp | 25 | ||||
-rw-r--r-- | tests/downloadspeed/downloadspeed.pro | 2 | ||||
-rw-r--r-- | tests/environmentvariable/environmentvariable.pro | 1 |
4 files changed, 39 insertions, 5 deletions
diff --git a/tests/auto/installer/scriptengine/tst_scriptengine.cpp b/tests/auto/installer/scriptengine/tst_scriptengine.cpp index 23c4b2c4c..0bbb79060 100644 --- a/tests/auto/installer/scriptengine/tst_scriptengine.cpp +++ b/tests/auto/installer/scriptengine/tst_scriptengine.cpp @@ -200,6 +200,8 @@ private slots: QCOMPARE(global.hasProperty(QLatin1String("InstallerProxy")), true); QCOMPARE(global.property(QLatin1String("InstallerProxy")) .hasProperty(QLatin1String("componentByName")), true); + QCOMPARE(global.property(QLatin1String("InstallerProxy")) + .hasProperty(QLatin1String("components")), true); QCOMPARE(global.hasProperty(QLatin1String("QDesktopServices")), true); QCOMPARE(global.property(QLatin1String("QDesktopServices")) @@ -302,6 +304,20 @@ private slots: QCOMPARE(value.isError(), true); } + void testComponents() + { + const QString script = QString::fromLatin1("var components = installer.components();" + "\n" + "print(components[0].name);"); + + setExpectedScriptOutput("\"component.test.name\""); + const QJSValue value = m_scriptEngine->evaluate(script); + if (value.isError()) { + QFAIL(qPrintable(QString::fromLatin1("ScriptEngine error:\n %1").arg( + value.toString()))); + } + } + void loadSimpleComponentScript() { try { diff --git a/tests/auto/installer/solver/tst_solver.cpp b/tests/auto/installer/solver/tst_solver.cpp index b661d3158..460ed4323 100644 --- a/tests/auto/installer/solver/tst_solver.cpp +++ b/tests/auto/installer/solver/tst_solver.cpp @@ -269,15 +269,36 @@ private slots: componentB->setValue(QLatin1String("AutoDependOn"), QLatin1String("A")); componentB->setValue(QLatin1String("Default"), QLatin1String("true")); + core->appendRootComponent(componentA); + core->appendRootComponent(componentB); ComponentToStringList result; result[componentB].append(QLatin1String("Component B specifies \"Default\" property " - "together with \"AutoDependOn\" list. This combination of states " - "may not work properly.")); + "together with \"AutoDependOn\" list. This combination of states " + "may not work properly.")); QTest::newRow("AutoDepend and default") << (QList<Component *>() << componentA << componentB) << result; + + NamedComponent *componentC = new NamedComponent(core, QLatin1String("C")); + NamedComponent *componentD = new NamedComponent(core, QLatin1String("D")); + NamedComponent *componentE = new NamedComponent(core, QLatin1String("E")); + + componentD->setValue(QLatin1String("AutoDependOn"), QLatin1String("C")); + componentE->addDependency(QLatin1String("D")); + core->appendRootComponent(componentC); + core->appendRootComponent(componentD); + core->appendRootComponent(componentE); + + result.clear(); + result[componentD].append(QLatin1String("Other components depend on auto dependent " + "component D. This may not work properly.")); + + QTest::newRow("AutoDepend and dependency") + << (QList<Component *>() << componentC << componentD << componentE) + << result; + } void checkComponent() diff --git a/tests/downloadspeed/downloadspeed.pro b/tests/downloadspeed/downloadspeed.pro index 0ffd8b991..79af1334e 100644 --- a/tests/downloadspeed/downloadspeed.pro +++ b/tests/downloadspeed/downloadspeed.pro @@ -9,8 +9,6 @@ QT += network CONFIG += console -DESTDIR = $$IFW_APP_PATH - SOURCES += main.cpp macx:include(../../no_app_bundle.pri) diff --git a/tests/environmentvariable/environmentvariable.pro b/tests/environmentvariable/environmentvariable.pro index 39cc7e99e..d6e7e5043 100644 --- a/tests/environmentvariable/environmentvariable.pro +++ b/tests/environmentvariable/environmentvariable.pro @@ -8,7 +8,6 @@ QT -= gui QT += testlib CONFIG += console -DESTDIR = $$IFW_APP_PATH HEADERS = environmentvariabletest.h SOURCES = environmentvariabletest.cpp |