Commit 412e61d2 authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlJS: Fix tests.



* Some were not adjusted for the Document::MutablePtr change.
* The basic test failed because the welcome plugin failed to load.
* The check test wasn't updated for @disable -> @disable-check.

Change-Id: Iae848832f740363bc33915d7a202a6cff08e2189
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@nokia.com>
parent 041fe253
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include <qmljstools/qmljsmodelmanager.h> #include <qmljstools/qmljsmodelmanager.h>
#include <qmldesigner/designercore/include/metainfo.h> #include <qmldesigner/designercore/include/metainfo.h>
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <extensionsystem/pluginspec.h>
#include <QtTest> #include <QtTest>
...@@ -94,6 +95,13 @@ void tst_Basic::initTestCase() ...@@ -94,6 +95,13 @@ void tst_Basic::initTestCase()
pluginManager->setSettings(settings); pluginManager->setSettings(settings);
pluginManager->setFileExtension(QLatin1String("pluginspec")); pluginManager->setFileExtension(QLatin1String("pluginspec"));
pluginManager->setPluginPaths(QStringList() << QLatin1String(Q_PLUGIN_PATH)); pluginManager->setPluginPaths(QStringList() << QLatin1String(Q_PLUGIN_PATH));
// skip the welcome plugin, it fails to load correctly
foreach (ExtensionSystem::PluginSpec *pluginSpec, pluginManager->plugins()) {
if (pluginSpec->name() == QLatin1String("Welcome"))
pluginSpec->setEnabled(false);
}
pluginManager->loadPlugins(); pluginManager->loadPlugins();
// the resource path is wrong, have to load things manually // the resource path is wrong, have to load things manually
......
...@@ -3,13 +3,13 @@ import Qt 4.7 ...@@ -3,13 +3,13 @@ import Qt 4.7
Rectangle { Rectangle {
function foo() { function foo() {
a + b // 127 9 13 a + b // 127 9 13
// @disable M127 // @disable-check M127
a + b a + b
a + b // @disable M127 a + b // @disable-check M127
// @disable M127 31 12 24 // @disable-check M127 31 12 30
// @disable M126 31 12 24 // @disable-check M126 31 12 30
a + b // 127 9 13 a + b // 127 9 13
} }
} }
...@@ -114,7 +114,7 @@ void tst_Check::test() ...@@ -114,7 +114,7 @@ void tst_Check::test()
QFETCH(QString, path); QFETCH(QString, path);
Snapshot snapshot; Snapshot snapshot;
Document::Ptr doc = Document::create(path, Document::QmlLanguage); Document::MutablePtr doc = Document::create(path, Document::QmlLanguage);
QFile file(doc->fileName()); QFile file(doc->fileName());
file.open(QFile::ReadOnly | QFile::Text); file.open(QFile::ReadOnly | QFile::Text);
doc->setSource(file.readAll()); doc->setSource(file.readAll());
......
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS += qmldesigner \ SUBDIRS += qmldesigner \
# qmleditor \ qmleditor \
qmlprojectmanager \ qmlprojectmanager \
codemodel codemodel
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS += qmllookup qmlcodeformatter SUBDIRS += \
# qmllookup \
qmlcodeformatter
...@@ -336,7 +336,7 @@ int main(int argc, char *argv[]) ...@@ -336,7 +336,7 @@ int main(int argc, char *argv[])
const QByteArray source = file.readAll(); const QByteArray source = file.readAll();
file.close(); file.close();
Document::Ptr doc = Document::create(fileName, Document::guessLanguageFromSuffix(fileName)); Document::MutablePtr doc = Document::create(fileName, Document::guessLanguageFromSuffix(fileName));
doc->setSource(source); doc->setSource(source);
doc->parse(); doc->parse();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment