From 5ed380ebcf8ef1157f651cbdef8393ccac897ee2 Mon Sep 17 00:00:00 2001 From: kh1 Date: Wed, 8 May 2013 11:21:37 +0200 Subject: 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 --- .../installerscriptengine/installerscriptengine.pro | 3 +++ .../tst_installerscriptengine.cpp | 19 ++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'tests/auto') 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()@:///data/component2.qs:5\" "); +#else + "\tComponent() at :///data/component2.qs:5\n" + "\t() at -1\" "); +#endif try { // ignore Output from script setExpectedScriptOutput("script function: Component"); -- cgit v1.2.3