1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** All rights reserved.
|
---|
5 | ** Contact: Nokia Corporation ([email protected])
|
---|
6 | **
|
---|
7 | ** This file is part of the documentation of the Qt Toolkit.
|
---|
8 | **
|
---|
9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
10 | ** Commercial Usage
|
---|
11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
14 | ** a written agreement between you and Nokia.
|
---|
15 | **
|
---|
16 | ** GNU Lesser General Public License Usage
|
---|
17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
18 | ** General Public License version 2.1 as published by the Free Software
|
---|
19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
20 | ** packaging of this file. Please review the following information to
|
---|
21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
23 | **
|
---|
24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
27 | **
|
---|
28 | ** GNU General Public License Usage
|
---|
29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
30 | ** General Public License version 3.0 as published by the Free Software
|
---|
31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | ** packaging of this file. Please review the following information to
|
---|
33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | **
|
---|
36 | ** If you have questions regarding the use of this file, please contact
|
---|
37 | ** Nokia at [email protected].
|
---|
38 | ** $QT_END_LICENSE$
|
---|
39 | **
|
---|
40 | ****************************************************************************/
|
---|
41 |
|
---|
42 | /*!
|
---|
43 | \page qtestlib-manual.html
|
---|
44 | \title QTestLib Manual
|
---|
45 | \brief An overview of Qt's unit testing framework.
|
---|
46 |
|
---|
47 | \ingroup frameworks-technologies
|
---|
48 | \keyword qtestlib
|
---|
49 |
|
---|
50 | The QTestLib framework, provided by Nokia, is a tool for unit
|
---|
51 | testing Qt based applications and libraries. QTestLib provides
|
---|
52 | all the functionality commonly found in unit testing frameworks as
|
---|
53 | well as extensions for testing graphical user interfaces.
|
---|
54 |
|
---|
55 | Table of contents:
|
---|
56 |
|
---|
57 | \tableofcontents
|
---|
58 |
|
---|
59 | \section1 QTestLib Features
|
---|
60 |
|
---|
61 | QTestLib is designed to ease the writing of unit tests for Qt
|
---|
62 | based applications and libraries:
|
---|
63 |
|
---|
64 | \table
|
---|
65 | \header \o Feature \o Details
|
---|
66 | \row
|
---|
67 | \o \bold Lightweight
|
---|
68 | \o QTestLib consists of about 6000 lines of code and 60
|
---|
69 | exported symbols.
|
---|
70 | \row
|
---|
71 | \o \bold Self-contained
|
---|
72 | \o QTestLib requires only a few symbols from the Qt Core library
|
---|
73 | for non-gui testing.
|
---|
74 | \row
|
---|
75 | \o \bold {Rapid testing}
|
---|
76 | \o QTestLib needs no special test-runners; no special
|
---|
77 | registration for tests.
|
---|
78 | \row
|
---|
79 | \o \bold {Data-driven testing}
|
---|
80 | \o A test can be executed multiple times with different test data.
|
---|
81 | \row
|
---|
82 | \o \bold {Basic GUI testing}
|
---|
83 | \o QTestLib offers functionality for mouse and keyboard simulation.
|
---|
84 | \row
|
---|
85 | \o \bold {Benchmarking}
|
---|
86 | \o QTestLib supports benchmarking and provides several measurement back-ends.
|
---|
87 | \row
|
---|
88 | \o \bold {IDE friendly}
|
---|
89 | \o QTestLib outputs messages that can be interpreted by Visual
|
---|
90 | Studio and KDevelop.
|
---|
91 | \row
|
---|
92 | \o \bold Thread-safety
|
---|
93 | \o The error reporting is thread safe and atomic.
|
---|
94 | \row
|
---|
95 | \o \bold Type-safety
|
---|
96 | \o Extensive use of templates prevent errors introduced by
|
---|
97 | implicit type casting.
|
---|
98 | \row
|
---|
99 | \o \bold {Easily extendable}
|
---|
100 | \o Custom types can easily be added to the test data and test output.
|
---|
101 | \endtable
|
---|
102 |
|
---|
103 | Note: For higher-level GUI and application testing needs, please
|
---|
104 | see the \l{Third-Party Tools}{Qt testing products provided by
|
---|
105 | Nokia partners}.
|
---|
106 |
|
---|
107 |
|
---|
108 | \section1 QTestLib API
|
---|
109 |
|
---|
110 | All public methods are in the \l QTest namespace. In addition, the
|
---|
111 | \l QSignalSpy class provides easy introspection for Qt's signals and slots.
|
---|
112 |
|
---|
113 |
|
---|
114 | \section1 Using QTestLib
|
---|
|
---|