Document how to use CMake for Qt TestLib
Task-number: QTBUG-73058 Change-Id: I6e29a83a1346ea0d2f94fcf445e1de9c07072aa6 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This commit is contained in:
parent
cede00ec89
commit
ec3ba7209e
@ -44,6 +44,7 @@ sources += ../../corelib/kernel/qtestsupport_core.cpp \
|
||||
|
||||
exampledirs += ../../../examples/qtestlib \
|
||||
../ \
|
||||
. / \
|
||||
snippets
|
||||
|
||||
excludedirs += ../../../examples/widgets/doc
|
||||
|
4
src/testlib/doc/snippets/CMakeLists.txt
Normal file
4
src/testlib/doc/snippets/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
#! [cmake_use]
|
||||
find_package(Qt6 COMPONENTS Test REQUIRED)
|
||||
target_link_libraries(mytarget Qt::Test)
|
||||
#! [cmake_use]
|
@ -1,6 +1,10 @@
|
||||
TEMPLATE = app
|
||||
TARGET = testlib_cppsnippet
|
||||
QT = core testlib sql widgets
|
||||
QT = core sql widgets
|
||||
|
||||
#! [qmake_use]
|
||||
QT += testlib
|
||||
#! [qmake_use]
|
||||
|
||||
SOURCES += code/src_qtestlib_qtestcase.cpp \
|
||||
code/doc_src_qtestlib.cpp \
|
||||
|
@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
@ -40,17 +40,13 @@
|
||||
to work with the Qt version it was developed against. However, source
|
||||
compatibility is guaranteed.
|
||||
|
||||
\section1 Getting Started
|
||||
\include module-use.qdocinc using qt module
|
||||
\snippet snippets/CMakeLists.txt cmake_use
|
||||
|
||||
To enable Qt Test in a project, add this directive into the C++ files:
|
||||
See also the \l[QtDoc]{Building with CMake} overview.
|
||||
|
||||
\snippet code/doc_src_qttest.cpp 0
|
||||
|
||||
\if !define(qtforpython)
|
||||
To link against Qt Test, add this line to the project file:
|
||||
|
||||
\snippet code/doc_src_qttest.pro 1
|
||||
\endif
|
||||
\include module-use.qdocinc building with qmake
|
||||
\snippet snippets/snippets.pro qmake_use
|
||||
|
||||
\section1 Articles and Guides
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
@ -35,22 +35,6 @@
|
||||
|
||||
\brief Provides classes for unit testing Qt applications and libraries.
|
||||
|
||||
Applications that use Qt's unit testing classes need to
|
||||
be configured to be built against the Qt Test module.
|
||||
To include the definitions of the module's classes, use the
|
||||
following directive:
|
||||
|
||||
\snippet code/doc_src_qttest.cpp 0
|
||||
|
||||
\if !defined(qtforpython)
|
||||
To link against the module, add this line to your \l qmake \c
|
||||
.pro file:
|
||||
|
||||
\snippet code/doc_src_qttest.pro 1
|
||||
\endif
|
||||
|
||||
See \l{Qt Test Overview} for an introduction on how to use
|
||||
Qt's unit testing features with your applications.
|
||||
|
||||
See the \l{Qt Test} page and the \l{Qt Test Overview} guide for further
|
||||
information about using this module in your application.
|
||||
*/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user