summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-08-19 05:40:20 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-08-19 05:40:20 (GMT)
commitb1e8d7aacf86e0ae5cb4910905c61dad434fe934 (patch)
tree112aaa291d1b31509730904a20c77d926d6b0164
parent78b1aa100d0a853ce1fe7df03a170887f461ede3 (diff)
downloadQt-b1e8d7aacf86e0ae5cb4910905c61dad434fe934.zip
Qt-b1e8d7aacf86e0ae5cb4910905c61dad434fe934.tar.gz
Qt-b1e8d7aacf86e0ae5cb4910905c61dad434fe934.tar.bz2
installed imports test
-rw-r--r--tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest.qml2
-rw-r--r--tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir1
-rw-r--r--tests/auto/declarative/qmlparser/tst_qmlparser.cpp11
3 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest.qml b/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest.qml
new file mode 100644
index 0000000..65f0276
--- /dev/null
+++ b/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest.qml
@@ -0,0 +1,2 @@
+import Qt 4.6
+Rect {}
diff --git a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir b/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir
new file mode 100644
index 0000000..41e2f2c
--- /dev/null
+++ b/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir
@@ -0,0 +1 @@
+InstalledTest 1.0 InstalledTest.qml
diff --git a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp
index 258eaa1..5ed41ef 100644
--- a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp
+++ b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp
@@ -13,6 +13,8 @@ class tst_qmlparser : public QObject
public:
tst_qmlparser() {
QmlMetaType::registerCustomStringConverter(qMetaTypeId<MyCustomVariantType>(), myCustomVariantTypeConverter);
+ QFileInfo fileInfo(__FILE__);
+ engine.addImportPath(fileInfo.absoluteDir().filePath(QLatin1String("lib")));
}
private slots:
@@ -512,6 +514,7 @@ void tst_qmlparser::imports_data()
QTest::addColumn<QString>("qml");
QTest::addColumn<QString>("type");
+ // import built-ins
QTest::newRow("missing import")
<< "Test {}"
<< "";
@@ -600,6 +603,8 @@ void tst_qmlparser::imports_data()
"import com.nokia.Test 1.10 as T10\n"
"T10.Test {}"
<< "";
+
+ // import locals
QTest::newRow("local import")
<< "import \"subdir\"\n"
"Test {}"
@@ -617,6 +622,12 @@ void tst_qmlparser::imports_data()
"import com.nokia.Test 1.0\n"
"Test {}"
<< "TestType";
+
+ // import installed
+ QTest::newRow("installed import")
+ << "import com.nokia.installedtest 1.0\n"
+ "InstalledTest {}"
+ << "QFxRect";
}
void tst_qmlparser::imports()