1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-06-09 21:39:34 +00:00

gcovr: Exclude sip-provider.c and dummy-provider.c

gcovr > 5.1 (which is included in the latest Debian CI image) fails an
assertion because two different functions with the same name end up on
different lines because they are #ifdef'ed

The offending code is this:

G_DEFINE_TYPE_WITH_CODE
  (CallsDummyProvider, calls_dummy_provider, CALLS_TYPE_PROVIDER,
  G_IMPLEMENT_INTERFACE (CALLS_TYPE_MESSAGE_SOURCE,
                         calls_dummy_provider_message_source_interface_init))

G_DEFINE_DYNAMIC_TYPE_EXTENDED
  (CallsDummyProvider, calls_dummy_provider, CALLS_TYPE_PROVIDER, 0,
   G_IMPLEMENT_INTERFACE_DYNAMIC (CALLS_TYPE_MESSAGE_SOURCE,
                                  calls_dummy_provider_message_source_interface_init))

There is already a gcovr issue here:
https://github.com/gcovr/gcovr/issues/586

The failed assertion looks like this:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gcovr/workers.py", line 78, in worker
    work(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/gcovr/gcov.py", line 337, in process_datafile
    done = run_gcov_and_process_files(
  File "/usr/lib/python3/dist-packages/gcovr/gcov.py", line 514, in run_gcov_and_process_files
    process_gcov_data(fname, covdata, abs_filename, options)
  File "/usr/lib/python3/dist-packages/gcovr/gcov.py", line 165, in process_gcov_data
    insert_file_coverage(covdata, coverage)
  File "/usr/lib/python3/dist-packages/gcovr/merging.py", line 159, in insert_file_coverage
    return _insert_coverage_item(target, file.filename, file, merge_file, options)
  File "/usr/lib/python3/dist-packages/gcovr/merging.py", line 135, in _insert_coverage_item
    merged_item = merge_item(target_dict[key], new_item, options)
  File "/usr/lib/python3/dist-packages/gcovr/merging.py", line 178, in merge_file
    left.functions = _merge_dict(
  File "/usr/lib/python3/dist-packages/gcovr/merging.py", line 99, in _merge_dict
    _insert_coverage_item(left, key, right_item, merge_item, options)
  File "/usr/lib/python3/dist-packages/gcovr/merging.py", line 135, in _insert_coverage_item
    merged_item = merge_item(target_dict[key], new_item, options)
  File "/usr/lib/python3/dist-packages/gcovr/merging.py", line 268, in merge_function
    assert left.lineno == right.lineno
AssertionError
This commit is contained in:
Evangelos Ribeiro Tzaras 2022-11-18 16:12:26 +01:00
parent ff69273e20
commit d3a93bd66a

View file

@ -1,2 +1,8 @@
exclude = src/dbus
exclude = subprojects/
exclude = subprojects/
# exclude calls-dummy-provider.c and calls-sip-provider.c as
# gcovr currently can't handle having the same function name twice on different lines:
# #ifdef FOR_TESTING switches between G_DEFINE_TYPE and a G_DEFINE_DYNAMIC_TYPE
# see https://github.com/gcovr/gcovr/issues/586
exclude = plugins/provider/dummy/calls-dummy-provider.c
exclude = plugins/provider/sip/calls-sip-provider.c