summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@theqtcompany.com>2015-03-10 17:01:26 +0100
committerJarek Kobus <jaroslaw.kobus@theqtcompany.com>2015-03-11 09:53:38 +0000
commit8c2941ae5892826520cccc946d13c17c8cc347f0 (patch)
treed93f36c190c653a77981e0da2ba4f98c211a67da /tests
parentdd2c70b10ddf0424ee96a30efcf0df93e88ef491 (diff)
Issue a warning when a component depends on auto dependent one.
Task-number: QTIFW-510 Change-Id: I57eff879deebf8f31a472a6c66a7e275e34447bd Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/installer/solver/tst_solver.cpp25
1 files changed, 23 insertions, 2 deletions
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()