summaryrefslogtreecommitdiffstats
path: root/tests/auto/installer
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2013-05-08 11:21:37 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2013-05-08 12:51:50 +0200
commit5ed380ebcf8ef1157f651cbdef8393ccac897ee2 (patch)
tree2cb377d2a83a9f36289e13cbca38a3266c461942 /tests/auto/installer
parent670527e34ea6aee96f381d0f51302320d87d00a3 (diff)
Fix auto test.
- fix debug message to make the test pass - remove superfluous 90's style line break marker Change-Id: Ib2659f50f0c9aa9ffaceec0ba79850377618d58f Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Diffstat (limited to 'tests/auto/installer')
-rw-r--r--tests/auto/installer/installerscriptengine/installerscriptengine.pro3
-rw-r--r--tests/auto/installer/installerscriptengine/tst_installerscriptengine.cpp19
2 files changed, 15 insertions, 7 deletions
diff --git a/tests/auto/installer/installerscriptengine/installerscriptengine.pro b/tests/auto/installer/installerscriptengine/installerscriptengine.pro
index b54096a2a..055efc12a 100644
--- a/tests/auto/installer/installerscriptengine/installerscriptengine.pro
+++ b/tests/auto/installer/installerscriptengine/installerscriptengine.pro
@@ -1,6 +1,9 @@
include(../../qttest.pri)
QT += script
+greaterThan(QT_MAJOR_VERSION, 4) {
+ QT += widgets
+}
SOURCES += tst_installerscriptengine.cpp
diff --git a/tests/auto/installer/installerscriptengine/tst_installerscriptengine.cpp b/tests/auto/installer/installerscriptengine/tst_installerscriptengine.cpp
index fa4669b56..4d629e08f 100644
--- a/tests/auto/installer/installerscriptengine/tst_installerscriptengine.cpp
+++ b/tests/auto/installer/installerscriptengine/tst_installerscriptengine.cpp
@@ -43,7 +43,7 @@ private slots:
void initTestCase()
{
m_component = new Component(&m_core);
- // append the component to the packagemanager which deletes it at destructor
+ // append the component to the package manager which deletes it at destructor
// (it calls clearAllComponentLists which calls qDeleteAll(m_rootComponents);)
m_core.appendRootComponent(m_component);
@@ -76,7 +76,7 @@ private slots:
void testComponentByName()
{
- const QString printComponentNameScript = QString::fromLatin1("var correctComponent = " \
+ const QString printComponentNameScript = QString::fromLatin1("var correctComponent = "
"installer.componentByName('%1');\nprint(correctComponent.name);").arg(m_component->name());
setExpectedScriptOutput("component.test.name");
@@ -89,7 +89,7 @@ private slots:
void testComponentByWrongName()
{
- const QString printComponentNameScript = QString::fromLatin1( "var brokenComponent = " \
+ const QString printComponentNameScript = QString::fromLatin1( "var brokenComponent = "
"installer.componentByName('%1');\nprint(brokenComponent.name);").arg("MyNotExistingComponentName");
m_scriptEngine->evaluate(printComponentNameScript);
@@ -132,18 +132,23 @@ private slots:
} catch (const Error &error) {
QFAIL(qPrintable(error.message()));
}
-
}
+
void loadBrokenComponentScript()
{
PackageManagerCore core;
Component testComponent(&core);
const QString debugMesssage(
- "create Error-Exception: \"Exception while loading the component script: :///data/component2.qs\n\n" \
- "ReferenceError: Can't find variable: broken\n\n" \
- "Backtrace:\n" \
+ "create Error-Exception: \"Exception while loading the component script: :///data/component2.qs\n\n"
+ "ReferenceError: Can't find variable: broken\n\n"
+ "Backtrace:\n"
+#if QT_VERSION < 0x050000
"\t<anonymous>()@:///data/component2.qs:5\" ");
+#else
+ "\tComponent() at :///data/component2.qs:5\n"
+ "\t<global>() at -1\" ");
+#endif
try {
// ignore Output from script
setExpectedScriptOutput("script function: Component");