Giter Site home page Giter Site logo

Comments (28)

calidion avatar calidion commented on September 26, 2024 1

@totoc1001 @myrgy

you can check code here.

https://github.com/vigcoin/coin

the error info can be found here:

https://circleci.com/gh/vigcoin/coin/43

from lcov.

oberpar avatar oberpar commented on September 26, 2024 1

You need to add a pattern for the "tests" directory to the lcov --remove call.

from lcov.

oberpar avatar oberpar commented on September 26, 2024 1

You're using this command line:

lcov --remove temp.info "/usr/include/*" "./include/*" "./tests/*"

Note that lcov does not expand the "." in this command line to mean the current working directory. I would assume that the paths in the coverage data file are in absolute form, so that the relative "." will not match anything (since there's no absolute directory named ".").

Try specifying the path in absolute form. Something like the following should remove all occurrences of tests and include sub-directories (which may be more than you intended).

lcov --remove temp.info "/usr/include/*" "*/include/*" "*/tests/*"

from lcov.

myrgy avatar myrgy commented on September 26, 2024

Hi @calidion ,

you can remove that files using lcov --remove coverage.info excludes_pattern

from lcov.

calidion avatar calidion commented on September 26, 2024

@myrgy
it seems not working.
I use

lcov --remove coverage.info '/usr/include/*' './include/*'

but /usr/include still in the generated html.

from lcov.

myrgy avatar myrgy commented on September 26, 2024
>>lcov --remove coverage.info '/usr/include/*' './include/*'  --output-file coverage2.info
>>genhtml coverage2.info

Im my case I'm creating a new filtered file. But according to lcov manual it should work with original file as well. I would recommend you play with generated DB using command line.

  -r tracefile pattern
       --remove tracefile pattern
              Remove data from tracefile.

              Use this switch if you want to remove coverage data for  a  par‐
              ticular  set  of files from a tracefile. Additional command line
              parameters will be interpreted as shell wildcard patterns  (note
              that  they  may  need  to  be escaped accordingly to prevent the
              shell from expanding them first).  Every file entry in tracefile
              which matches at least one of those patterns will be removed.

              The  result of the remove 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.

It should work since I have exactly the same set up in my projects.

from lcov.

calidion avatar calidion commented on September 26, 2024

not working.

cmd:

lcov --remove temp.info '/usr/include/*' './include/*' --output-file coverage.info

result:

Writing data to coverage.info
lcov: ERROR: cannot write to coverage.info!

from lcov.

totoc1001 avatar totoc1001 commented on September 26, 2024

from lcov.

calidion avatar calidion commented on September 26, 2024

thanks.

I solved by double quotes and redirection.

lcov --remove temp.info "/usr/include/*" "./include/*" > coverage.info

from lcov.

myrgy avatar myrgy commented on September 26, 2024

you may use --output-file instead of redirection.

from lcov.

calidion avatar calidion commented on September 26, 2024

--output-file seems not working.

from lcov.

calidion avatar calidion commented on September 26, 2024

confirmed.

> lcov --remove temp.info "/usr/include/*" "./include/*" --output-file coverage.info
Deleted 289 files
Writing data to coverage.info
lcov: ERROR: cannot write to coverage.info!

from lcov.

myrgy avatar myrgy commented on September 26, 2024

Just in case - does this file exist? In my script I remove all files after coverage generation.

from lcov.

calidion avatar calidion commented on September 26, 2024

I have tested this case. Have no relevance.

from lcov.

myrgy avatar myrgy commented on September 26, 2024

Unfortunately I have no idea why it doesn't work for you.
Try to study lcov manual pages.
Seems like you call is correct:

       lcov -r|--remove tracefile pattern
            [-o|--output-file tracefile] [--checksum] [--no-checksum]
            [-q|--quiet] [--config-file config-file] [--rc keyword=value]

so issue might be related to wrong working dir and some restriction issues.
Looks like --output-file works fine for @totoc1001. So I assume that you have some local issue.

from lcov.

calidion avatar calidion commented on September 26, 2024

@myrgy

I don't know why.
the output temp.info is ok.

from lcov.

myrgy avatar myrgy commented on September 26, 2024

I checked my script - we are using --quiet flag. and in general that's all difference.

COMMAND ${LCOV_PATH} --quiet --remove ${Coverage_NAME}.info ${Coverage_EXCLUDES} --output-file ${Coverage_NAME}.info.cleaned

from lcov.

totoc1001 avatar totoc1001 commented on September 26, 2024

from lcov.

myrgy avatar myrgy commented on September 26, 2024

it's sequenced with other lcov command as a cmake custom target. As a result if lcov fails - I'll notice that, otherwise it should work.

from lcov.

totoc1001 avatar totoc1001 commented on September 26, 2024

from lcov.

myrgy avatar myrgy commented on September 26, 2024

Thank you @totoc1001. I'll take a look or at least will disable --quiet.

from lcov.

totoc1001 avatar totoc1001 commented on September 26, 2024

from lcov.

calidion avatar calidion commented on September 26, 2024

try

./build-debug.sh

from lcov.

calidion avatar calidion commented on September 26, 2024

@myrgy @totoc1001

https://codecov.io/gh/vigcoin/coin

totally confused:
tests folder is still included

from lcov.

calidion avatar calidion commented on September 26, 2024

@oberpar still not working.

from lcov.

calidion avatar calidion commented on September 26, 2024

@oberpar
Thank you very much.
That's what exactly i want

from lcov.

calidion avatar calidion commented on September 26, 2024

It works on mac os too:)

from lcov.

calidion avatar calidion commented on September 26, 2024

LCOV - coverage.info.pdf

from lcov.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.