summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2010-12-09 10:03:48 +1000
committerRhys Weatherley <rhys.weatherley@nokia.com>2010-12-09 10:07:30 +1000
commitaf3a7a764686554e86da7dda7f2d17111abc8409 (patch)
tree79bbe93eb17001d3e59a65c8208b52ac41b5f2ab
parentc06d64bb49c26e13d8aa27275838389484bb64a0 (diff)
Install qmltestcase.prf for user applications
-rw-r--r--doc/testcases.txt9
-rw-r--r--features/qmltestcase.prf17
-rw-r--r--qtest-qml.pro15
3 files changed, 40 insertions, 1 deletions
diff --git a/doc/testcases.txt b/doc/testcases.txt
index 405edae..ac7e579 100644
--- a/doc/testcases.txt
+++ b/doc/testcases.txt
@@ -35,7 +35,14 @@ the following code:
QTEST_QUICK_MAIN(qmlexample)
Where "qmlexample" is an identifier to use to uniquely identify
-this set of tests.
+this set of tests. You should add "CONFIG += qmltestcase" to your
+*.pro file; for example:
+
+ TEMPLATE = app
+ TARGET = tst_qmlexample
+ CONFIG += warn_on qmltestcase
+ SOURCES += tst_qmlexample.cpp
+ RESOURCES += qmlexample.qrc
The test harness scans recursively for "tst_*.qml" files in the qrc
resources that are bound into the test harness binary. The following
diff --git a/features/qmltestcase.prf b/features/qmltestcase.prf
new file mode 100644
index 0000000..d5cbedc
--- /dev/null
+++ b/features/qmltestcase.prf
@@ -0,0 +1,17 @@
+CONFIG += testcase
+
+!symbian {
+ INCLUDEPATH += $$[QT_INSTALL_HEADERS]/QtQuickTest
+} else {
+ load(data_caging_paths)
+
+ INCLUDEPATH+=$$MW_LAYER_PUBLIC_EXPORT_PATH(QtQuickTest)
+}
+
+QT += declarative
+
+win32:CONFIG(debug, debug|release) {
+ LIBS += -lQtQuickTest$${QT_LIBINFIX}d
+} else {
+ LIBS += -lQtQuickTest$${QT_LIBINFIX}
+}
diff --git a/qtest-qml.pro b/qtest-qml.pro
index 26d5720..e9e3c94 100644
--- a/qtest-qml.pro
+++ b/qtest-qml.pro
@@ -1,3 +1,18 @@
TEMPLATE = subdirs
SUBDIRS = src tests
CONFIG += ordered
+
+# Install qmltestcase.prf into the Qt mkspecs so that "CONFIG += qmltestcase"
+# can be used in customer applications to build against QtQuickTest.
+feature.path = $$[QT_INSTALL_DATA]/mkspecs/features
+feature.files = $$PWD/features/qmltestcase.prf
+INSTALLS += feature
+
+#symbian does not generate make install rule. Copy prf manually
+symbian {
+ qmltestcaseFile=$$PWD\\features\\qmltestcase.prf
+ qmltestcaseFile=$$replace(qmltestcaseFile,/,\\)
+ featuresDir=$$[QT_INSTALL_DATA]\\mkspecs\\features
+ featuresDir=$$replace(featuresDir,/,\\)
+ system(copy "$$qmltestcaseFile $$featuresDir")
+}