Skip to content

extras: ci: ignore vlc_qrc.cpp coverage

When parsing the coverage with the Qt module enabled, gcovr was failing to parse the output for qt5-vlc_qrc.cpp, leading to the following error.

$ gcovr -r build-meson --json gcovr.cov.json                                                      130 ↵
(INFO) Reading coverage data...
(WARNING) Unrecognized GCOV output for /home/alexandre/workspace/videolabs/vlc-master/build-meson/modules/gui/qt/qt5-vlc_qrc.cpp
                37:60736-block  0
                37:60751-block  0
                37:60759-block  0
                37:60767-block  0
                37:60768-block  0
        This is indicative of a gcov output parse error.
        Please report this to the gcovr developers
        at <https://github.com/gcovr/gcovr/issues>.
(WARNING) Exception during parsing:
        UnknownLineType:        37:60736-block  0
(WARNING) Exception during parsing:
        UnknownLineType:        37:60751-block  0
(WARNING) Exception during parsing:
        UnknownLineType:        37:60759-block  0
(WARNING) Exception during parsing:
        UnknownLineType:        37:60767-block  0
(WARNING) Exception during parsing:
        UnknownLineType:        37:60768-block  0
(ERROR) Exiting because of parse errors.
        You can run gcovr with --gcov-ignore-parse-errors
        to continue anyway.
(ERROR) Trouble processing 'vlc/build-meson/modules/libqt_plugin.so.p/meson-generated_.._gui_qt_qt5-vlc_qrc.cpp.gcda' with working directory '/home/alexandre/workspace/videolabs/vlc-master/build-meson'.
Stdout of gcov was >>File 'modules/gui/qt/qt5-vlc_qrc.cpp'
Lines executed:100.00% of 13
No branches
Calls executed:100.00% of 5
Creating 'qt5-vlc_qrc.cpp##1ea0d75896cd542c555451d8b8bb4a44.gcov'

Previously, it was trying to merge lines and triggered a negative hit, leading to the introduction of the gcovr parameter: --gcov-ignore-parse-errors=negative_hits.warn_once_per_file. This option is not needed anymore.

Issue #28490 (closed) also mentioned the following assertion:

AssertionError: Got function MainUI::getComponent() const on multiple lines: 26, 27.
        You can run gcovr with --merge-mode-functions=MERGE_MODE.
        The available values for MERGE_MODE are described in the documentation.

This assertion was due to --merge-mode-functions1 not being accounted, which it now does in gcovr 7.02, and files using Q_OBJECT and the MOC code generator, duplicating some inline functions from headers.

class MainUI : public QObject {
    Q_OBJECT
public:
    /* The line below duplicates a function definition at two different
     * locations because of MOC. */
    inline QQmlComponent* getComponent() const {return m_component;}

We don't need this file to have its coverage checked since it's generated from an XML file, so let's just ignore it from the coverage entirely.

Fixes #28533 (closed) #28490 (closed)

  1. https://github.com/gcovr/gcovr/pull/700

  2. https://github.com/gcovr/gcovr/pull/844

Edited by Alexandre Janniaux

Merge request reports