forked from qt-creator/qt-creator
Doc: Describe creating Google tests
Change-Id: I462a1db8095be14c444bfaba3ae1bc21f7196a3a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -43,9 +43,13 @@
|
|||||||
\uicontrol {About Plugins} > \uicontrol Utilities > \uicontrol {Auto Test}.
|
\uicontrol {About Plugins} > \uicontrol Utilities > \uicontrol {Auto Test}.
|
||||||
Restart \QC to be able to use the plugin.
|
Restart \QC to be able to use the plugin.
|
||||||
|
|
||||||
\section1 Creating Qt Tests
|
\section1 Creating Tests
|
||||||
|
|
||||||
You can use a wizard to create projects that contain Qt tests:
|
You can use a wizard to create projects that contain Qt or Google tests.
|
||||||
|
|
||||||
|
\section2 Creating Qt Tests
|
||||||
|
|
||||||
|
To create a Qt test:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
||||||
@@ -58,6 +62,9 @@
|
|||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
|
\li In the \uicontrol {Test framework} field, select
|
||||||
|
\uicontrol {Qt Test}.
|
||||||
|
|
||||||
\li Select the \uicontrol {GUI Application} check box to create
|
\li Select the \uicontrol {GUI Application} check box to create
|
||||||
a Qt application.
|
a Qt application.
|
||||||
|
|
||||||
@@ -87,6 +94,52 @@
|
|||||||
function in your test. For more information about creating Qt tests, see
|
function in your test. For more information about creating Qt tests, see
|
||||||
\l{Creating a Test}.
|
\l{Creating a Test}.
|
||||||
|
|
||||||
|
\section2 Creating Google Tests
|
||||||
|
|
||||||
|
To create a Google test:
|
||||||
|
|
||||||
|
\list 1
|
||||||
|
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
||||||
|
\uicontrol {Other Project} > \uicontrol {Auto Test} >
|
||||||
|
\uicontrol Choose to create a project with boilerplate code for a
|
||||||
|
Google test.
|
||||||
|
|
||||||
|
\li In the \uicontrol {Project and Test Information} dialog, specify
|
||||||
|
settings for the project and test:
|
||||||
|
|
||||||
|
\list 1
|
||||||
|
|
||||||
|
\li In the \uicontrol {Test framework} field, select
|
||||||
|
\uicontrol {Google Test}.
|
||||||
|
|
||||||
|
\li In the \uicontrol {Test case name} field, enter a name for
|
||||||
|
the test case.
|
||||||
|
|
||||||
|
\li In the \uicontrol {Test set name} field, enter a name for
|
||||||
|
the test set.
|
||||||
|
|
||||||
|
\li Select the \uicontrol {Enable C++ 11} check box to
|
||||||
|
support C++ 11 features in the test.
|
||||||
|
|
||||||
|
\li In the \uicontrol {Build auto tests} field, select
|
||||||
|
\uicontrol Always to always build the test when building
|
||||||
|
the project or \uicontrol {Debug Only} to only build it
|
||||||
|
during debug builds.
|
||||||
|
|
||||||
|
\li In the \uicontrol {Google test repository} field, select
|
||||||
|
a directory that contains a clone of the googletest
|
||||||
|
repository.
|
||||||
|
|
||||||
|
To use an installed Google C++ Testing framework instead,
|
||||||
|
see \l{Setting Up the Google C++ Testing Framework}.
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
\QC creates the test in the \c{tests\auto} directory in the project
|
||||||
|
directory.
|
||||||
|
|
||||||
\section1 Setting Up the Google C++ Testing Framework
|
\section1 Setting Up the Google C++ Testing Framework
|
||||||
|
|
||||||
To build and run Google tests, you must have the Google C++ Testing
|
To build and run Google tests, you must have the Google C++ Testing
|
||||||
|
|||||||
@@ -170,10 +170,10 @@
|
|||||||
|
|
||||||
Qt unit tests for features or classes
|
Qt unit tests for features or classes
|
||||||
|
|
||||||
\li Qt Auto Test
|
\li Auto Test Project
|
||||||
|
|
||||||
Projects with boilerplate code for a Qt test. For more
|
Projects with boilerplate code for a Qt or Google test. For more
|
||||||
information, see \l {Creating Qt Tests}.
|
information, see \l {Creating Tests}.
|
||||||
|
|
||||||
\li Qt Quick UI
|
\li Qt Quick UI
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user