Skip to content

What is a correct way to disable code coverage instrumentation? #227

@ligurio

Description

@ligurio

I'm using tests 1 that uses LPM & Protobuf library. LPM is built using ExternalProjectAdd in CMake, see 2.
Fuzzing tests are running in OSS Fuzz Infrastructure (see build.sh in 3), where Fuzz Introspector reports are built.
Unfortunately, Fuzz Introspector includes LPM and Protobuf library to reports, and due to this overall code coverage result is wrong 4 and Protobuf functions bothers me to analyze reports, see an example in 5.

What is a correct way to disable code coverage instrumentation?

I see there is LIB_PROTO_MUTATOR_HAS_NO_COVERAGE, but it is not documented.

Footnotes

  1. https://github.com/ligurio/lua-c-api-tests

  2. https://github.com/ligurio/lua-c-api-tests/blob/e4c2a46510a72baf6e3741dbd7529e74aaf698e6/cmake/ProtobufMutator.cmake#L28-L45

  3. https://github.com/google/oss-fuzz/blob/318f612d3054293201a494190715bd6a207e477c/projects/lua/build.sh#L57-L75

  4. https://storage.googleapis.com/oss-fuzz-coverage/lua/reports/20230915/linux/src/testdir/build/tests/external.protobuf_mutator/src/report.html

  5. https://storage.googleapis.com/oss-fuzz-introspector/lua/inspector-report/20230915/fuzz_report.html#Fuzzer:-luaL_loadbuffer_proto_test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions