/****************************************************************************
**
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
**
** 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 The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/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: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/

/*!
    \previouspage creator-qml-performance-monitor.html
    \page creator-coco.html
    \nextpage creator-valgrind-overview.html

    \title Checking Code Coverage

    \l{https://doc.froglogic.com/squish-coco/latest/}{Squish Coco} is a complete
    code coverage tool chain for Tcl, QML, C# and C/C++ programs that runs on
    \macOS, Linux, and Windows.

    Squish Coco analyzes the way an application runs, as part of a test suite,
    for example. The results enable you to make the tests more efficient and
    complete.

    You can:

    \list
        \li Find untested code sections.
        \li Find redundant tests which can then be eliminated. Squish Coco can
            identify portions of the source code that are covered by a test. It
            can detect whether a new test covers lines in the source code that
            the existing tests do not cover.
        \li Find dead code by displaying code that is never executed.
        \li Calculate the optimum test execution order so as to maximize
            test coverage for each run. This is particularly useful for manual
            testing.
        \li Analyze two separate versions of an application and compare the
            differences. This makes it possible to see which tests are affected
            by source code modifications and also to get some measure of the
            test coverage of a patch or hot fix.
        \li Measure the execution time of applications and tests.
    \endlist

    The experimental Coco plugin integrates Coco CoverageBrowser into \QC.
    It enables you to analyze the test coverage by loading an instrumentation
    database (a .csmes file) that was generated by Coco CoverageScanner.
    It is currently supported only on Windows, with Squish Coco version 6.0,
    or later.

    To use the plugin, you must download and install Squish Coco.

    \section1 Enabling the Coco Plugin

    To enable the Coco plugin:

    \list 1
        \li Select \uicontrol Help > \uicontrol {About Plugins} >
            \uicontrol Utilities > \uicontrol Coco to enable the plugin.
        \li Select \uicontrol {Restart Now} to restart \QC and load the plugin.
    \endlist

    \section1 Configuring Coco

    \list 1
        \li Select \uicontrol Analyze > \uicontrol {Squish Coco}.
            \image qtcreator-coco.png "Coco CoverageBrowser and CSMes file"
        \li In \uicontrol {CoverageBrowser}, enter the path to the Coco
            coverage browser to use for analyzing a .csmes file.
        \li In \uicontrol CSMes, select the instrumentation database to load.
        \li Select \uicontrol Open to start CoverageBrowser.
        \li In CoverageBrowser, select \uicontrol File >
            \uicontrol {Load Execution Report} and select the .csexe for the
            coverage scan.
            \image coco-coveragebrowser-load-execution-report.png "Load Execution Report dialog"
        \li If you want to reuse the execution report, deselect the
            \uicontrol {Delete execution report after loading} check box.
    \endlist

    Open the analyzed files in \QC. The results of the analysis are displayed
    after the code in \uicontrol Edit mode. You can change the fonts and colors
    used for different types of results.

    \section1 Changing Fonts and Colors

    To change the default fonts and colors, select \uicontrol Edit >
    \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol {Font & Colors}.
    Create your own color scheme and select new fonts and colors for the
    following results:

    \list
        \li Code Coverage Added Code
        \li Partially Covered Code
        \li Uncovered Code
        \li Fully Covered Code
        \li Manually Validated Code
        \li Code Coverage Dead Code
        \li Code Coverage Execution Count too Low
        \li Implicitly Not Covered Code
        \li Implicitly Covered Code
        \li Implicit Manual Coverage Validation
    \endlist

    For more information, see \l{Specifying Text Editor Settings}.
*/
