diff options
Diffstat (limited to 'doc/src/index.qdoc')
-rw-r--r-- | doc/src/index.qdoc | 56 |
1 files changed, 21 insertions, 35 deletions
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 3e0939e..69aa496 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -83,53 +83,39 @@ \code #include <QtQuickTest/quicktest.h> - QUICK_TEST_MAIN(qmlexample) + QUICK_TEST_MAIN(example) \endcode - Where "qmlexample" is an identifier to use to uniquely identify - this set of tests. You should add \c{CONFIG += qmltestcase} to your - .pro file; for example: + Where "example" is an identifier to use to uniquely identify + this set of tests. You should add \c{CONFIG += qmltestcase} and + a definition for \c{QUICK_TEST_SOURCE_DIR} to your .pro file; + for example: \code TEMPLATE = app - TARGET = tst_qmlexample + TARGET = tst_example CONFIG += warn_on qmltestcase - SOURCES += tst_qmlexample.cpp - RESOURCES += qmlexample.qrc - \endcode - - The test harness scans recursively for "tst_*.qml" files in the qrc - resources that are bound into the test harness binary. The following - is an example .qrc file: - - \code - <!DOCTYPE RCC><RCC version="1.0"> - <qresource> - <file>tst_basic.qml</file> - <file>tst_item.qml</file> - </qresource> - </RCC> - \endcode - - The \c{QUICK_TEST_SOURCE_DIR} macro can be defined at compile time to - run tests from plain files without binding them into resources. - Modify your .pro file to include the following line: - - \code + SOURCES += tst_example.cpp DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$PWD\\\"\" \endcode - The \c{QUICK_TEST_SOURCE_DIR} environment variable can also be set - at runtime to run test cases from a different directory. This may - be needed to run tests on a target device where the compiled-in - directory name refers to a host. - + The test harness scans the specified source directory recursively + for "tst_*.qml" files. If \c{QUICK_TEST_SOURCE_DIR} is not defined, + then the current directory will be scanned when the harness is run. Other *.qml files may appear for auxillary QML components that are used by the test. + + The \c{-input} command-line option can be set at runtime to run + test cases from a different directory. This may be needed to run + tests on a target device where the compiled-in directory name refers + to a host. For example: + + \code + tst_example -input /mnt/SDCard/qmltests + \endcode - See \c{tests/qmlexample} in the source tree for an example of creating a - test harness that uses resources and \c{tests/qmlauto} for an example - that uses the \c{QUICK_TEST_SOURCE_DIR} macro. + See \c{tests/qmlauto} in the source tree for an example of creating a + test harness that uses the \c{QUICK_TEST_SOURCE_DIR} macro. If your test case needs QML imports, then you can add them as \c{-import} options to the the test program command-line by adding |