tests: Fix LCOV_OPTS to be in the correct position #28771

pull achow101 wants to merge 1 commits into bitcoin:master from achow101:lcov-opts changing 1 files +4 −4
  1. achow101 commented at 10:13 PM on November 1, 2023: member

    lcov's -a option takes an argument. With LCOV_OPTS immediately after -a, the first additional argument becomes the argument to -a which is incorrect.

    Also add LCOV_OPTS to more lcov calls.

  2. tests: Fix LCOV_OPTS to be in the correct position
    `lcov`'s `-a` option takes an argument. With `LCOV_OPTS` immediately
    after `-a`, the first additional argument becomes the argument to `-a`
    which is incorrect.
    
    Also add `LCOV_OPTS` to more `lcov` calls.
    88e09ac2a1
  3. DrahtBot commented at 10:13 PM on November 1, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK fanquake

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Tests on Nov 1, 2023
  5. maflcko commented at 8:53 AM on November 2, 2023: member

    Can you clarify whether this has any visible effect on the generated html? I presume only when branch coverage is enabled?

  6. achow101 commented at 12:26 AM on November 14, 2023: member

    Can you clarify whether this has any visible effect on the generated html? I presume only when branch coverage is enabled?

    It shouldn't, other than actually working. The man page for lcov says:

       -a tracefile_pattern
       --add-tracefile tracefile_pattern
              Add contents of all files matching glob pattern trcefile_pattern.
    
              Specify several tracefiles using the -a switch to combine the coverage data contained in
              these files by adding up execution counts for matching test and filename combinations.
    
              The  result  of  the  add operation will be written to stdout or the tracefile specified
              with -o.
    
              Only one of  -z, -c, -a, -e, -r, -l, --diff or --summary may be specified at a time.

    There clearly is an argument to the -a option. Anything that goes into LCOV_OPTS is not necessarily going to be the right argument, and the branch coverage opts certainly are not. I think it's obvious that what we currently have is just wrong.

  7. maflcko commented at 10:52 AM on November 14, 2023: member

    I agree that it is wrong. I mostly wonder why it was working fine previously, when it shouldn't.

  8. fanquake approved
  9. fanquake commented at 10:15 AM on November 16, 2023: member

    ACK 88e09ac2a15d674db9e814755602572be61241ff

    I mostly wonder why it was working fine previously, when it shouldn't.

    It looks like when LCOV_OPTS is set, during branch coverage, and we end up with something like lcov -a --rc lcov_branch_coverage=1 baseline_filtered.info, lcov just reads pass the extra arguments, and still uses the file, i.e:

    touch some_file
    lcov -a --rc lcov_branch_coverage=1 some_file
    Combining tracefiles.
    .. found 1 files to aggregate.
    Merging some_file..0 remaining
    lcov: ERROR: trace file 'some_file' is empty
    	(use "lcov --ignore-errors empty ..." to bypass this error)
    
  10. fanquake merged this on Nov 16, 2023
  11. fanquake closed this on Nov 16, 2023

  12. maflcko commented at 10:27 AM on November 16, 2023: member

    Thanks for taking a look. The --rc seems wrong as well? Previously it was ignored, but now I wonder why it doesn't lead to errors, because, according to the manpage:

    Only one of -z, -c, -a, -e, -r, -l and --diff may be specified at a time.
    
  13. fanquake commented at 10:43 AM on November 16, 2023: member

    I think --rc is different case, not included in that list, so it is also still working here?

    --rc keyword=value Override a configuration directive.

    Use this option to specify a keyword=value statement which overrides the corresponding configuration statement in the > lcovrc configuration file. You can specify this option more than once to override multiple configuration statements. See > lcovrc(5) for a list of available keywords and their meaning.

  14. bitcoin locked this on Nov 16, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 00:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me