diff options
Diffstat (limited to 'src/quick/doc/src/appdevguide/qtquicktest.qdoc')
-rw-r--r-- | src/quick/doc/src/appdevguide/qtquicktest.qdoc | 132 |
1 files changed, 0 insertions, 132 deletions
diff --git a/src/quick/doc/src/appdevguide/qtquicktest.qdoc b/src/quick/doc/src/appdevguide/qtquicktest.qdoc deleted file mode 100644 index 6d434279e6..0000000000 --- a/src/quick/doc/src/appdevguide/qtquicktest.qdoc +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page qtquick-qtquicktest.html - \inqmlmodule QtQuick 2 - \title Qt Quick Test Reference Documentation - \brief unit testing framework for QML - - \section1 Introduction - - QtQuickTest is a unit test framework for QML applications. - Test cases are written as JavaScript functions within a TestCase - type: - - \code - import QtQuick 2.0 - import QtTest 1.0 - - TestCase { - name: "MathTests" - - function test_math() { - compare(2 + 2, 4, "2 + 2 = 4") - } - - function test_fail() { - compare(2 + 2, 5, "2 + 2 = 5") - } - } - \endcode - - Functions whose names start with \c{test_} are treated as test cases - to be executed. See the documentation for the \l TestCase and - \l SignalSpy types for more information on writing test cases. - - \section1 Running tests - - Test cases are launched by a C++ harness that consists of - the following code: - - \code - #include <QtQuickTest/quicktest.h> - QUICK_TEST_MAIN(example) - \endcode - - Where "example" is an identifier to use to uniquely identify - this set of tests. You should add \c{CONFIG += qmltestcase}. - for example: - - \code - TEMPLATE = app - TARGET = tst_example - CONFIG += warn_on qmltestcase - SOURCES += tst_example.cpp - \endcode - - 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 - - It is also possible to run a single file using the \c{-input} option. - For example: - - \code - tst_example -input data/test.qml - \endcode - - \code - tst_example -input <full_path>/test.qml - \endcode - - \note Specifying the full path to the qml test file is for example - needed for shadow builds. - - If your test case needs QML imports, then you can add them as - \c{-import} options to the test program command-line by adding - the following line to your .pro file: - - \code - IMPORTPATH += $$PWD/../imports/my_module1 $$PWD/../imports/my_module2 - \endcode - - The \c{-functions} command-line option will return a list of the current - tests functions. It is possible to run a single test function using the name - of the test function as an argument. For example: - - \code - tst_example Test_Name::function1 - \endcode - - The \c{-help} command-line option will return all the options available. - - \code - tst_example -help - \endcode -*/ |