From ee0499ac579ecf27c029404fc974a6e1ffeffb53 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 22 Nov 2016 09:54:23 +0100 Subject: [PATCH] Doc: Describe creating Google tests Change-Id: I462a1db8095be14c444bfaba3ae1bc21f7196a3a Reviewed-by: Christian Stenger --- doc/src/howto/creator-autotest.qdoc | 57 ++++++++++++++++++- .../projects/creator-projects-creating.qdoc | 6 +- 2 files changed, 58 insertions(+), 5 deletions(-) diff --git a/doc/src/howto/creator-autotest.qdoc b/doc/src/howto/creator-autotest.qdoc index 65ffc374c05..b26e90885c9 100644 --- a/doc/src/howto/creator-autotest.qdoc +++ b/doc/src/howto/creator-autotest.qdoc @@ -43,9 +43,13 @@ \uicontrol {About Plugins} > \uicontrol Utilities > \uicontrol {Auto Test}. 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 \li Select \uicontrol File > \uicontrol {New File or Project} > @@ -58,6 +62,9 @@ \list 1 + \li In the \uicontrol {Test framework} field, select + \uicontrol {Qt Test}. + \li Select the \uicontrol {GUI Application} check box to create a Qt application. @@ -87,6 +94,52 @@ function in your test. For more information about creating Qt tests, see \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 To build and run Google tests, you must have the Google C++ Testing diff --git a/doc/src/projects/creator-projects-creating.qdoc b/doc/src/projects/creator-projects-creating.qdoc index 472cd41660b..bc474cba175 100644 --- a/doc/src/projects/creator-projects-creating.qdoc +++ b/doc/src/projects/creator-projects-creating.qdoc @@ -170,10 +170,10 @@ 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 - information, see \l {Creating Qt Tests}. + Projects with boilerplate code for a Qt or Google test. For more + information, see \l {Creating Tests}. \li Qt Quick UI