GithubHelp home page GithubHelp logo

kcov merge create empty result about kcov HOT 8 CLOSED

ohank avatar ohank commented on June 10, 2024
kcov merge create empty result

from kcov.

Comments (8)

SimonKagstrom avatar SimonKagstrom commented on June 10, 2024

Do the actual non-merged reports contain proper coverage data?

I tried it locally, and that seems to work:

kcov /tmp/kcov1 tests/bash/dollar-one-question.sh 5
kcov /tmp/kcov2 tests/python/second.py
kcov --merge /tmp/kcov3 /tmp/kcov2 /tmp/kcov1

and here kcov3 contains the merged report.

Maybe it has to do with the globbing? What happens if you manually (for testing) replaces ../kcov_test_* with the directories one by one?

from kcov.

ohank avatar ohank commented on June 10, 2024

First, run in a folder named kcov_test_1661350478
image
Second, run in a folder kcov_test_1661350517
image

The non-merged report looks good to me.

I tried this:

kcov --debug=31 --merge ../kcov_merge ../kcov_test_1661350478 ../kcov_test_1661350517

And did get the same output

Can't symlink readable name

image

The different i see are that i run kcov with --include-pattern=/home/ubuntu/workspace/ccs_shell/ccs/. I need to do this otherwise I get an error that c++ header files are not compiled.

from kcov.

SimonKagstrom avatar SimonKagstrom commented on June 10, 2024

I can't really say why this happens. One thing you could try is to add debug printouts where the "Can't symlink readable name" is output (output-handler.cc). Not sure if that's the root cause, but something is strange if it fails.

Also, if you're collecting coverage for the same binary, kcov will automatically accumulate multiple runs (with the same output directory). So if that's what you're aiming for, simply run it with the same output directory multiple times.

Merging is meant to be used if there are multiple binaries with overlapping source code.

from kcov.

ohank avatar ohank commented on June 10, 2024

The "Can't symlink readable name" is not blocking as I test with a simple python script and the merge work with this error:
image

And when I try to do the same on the c++ application:
image

I have tried to save the cov result in the same folder and it writes of others for each time the binary is started. But the python script merges the cov result if I use the same folder.

from kcov.

ohank avatar ohank commented on June 10, 2024

I have looked in the code and found out that I didn't get a metadata file. That is why the merges are not working.

As of now, I am looking into why the metadata file is not created when running kcov on the binary. When I run it on the python program I talk about I the last comment I get a metadata file.

from kcov.

SimonKagstrom avatar SimonKagstrom commented on June 10, 2024

Good debugging!

The metadata file should be written out when kcov exits, so it's strange that it doesn't show up. Still, I think it sounds like the symlink issue can have something to do with it. It's not that disk space (where the kcov output is placed) runs out?

from kcov.

ohank avatar ohank commented on June 10, 2024

We did find out why the metadata files were not created. As we start more than one binary file to start a simulator we added the kcov command before starting the simulator's binary files. And when we stop the simulator all the processes are kill at the same time and the included the kcov prosses and the onStop function did have time to run and did not create the metadata files. When we kill the binary first and the kcov process we get the metadata files and the merge for fine.

So I look into how to kill the prosses so kcov has time to create the files.

from kcov.

SimonKagstrom avatar SimonKagstrom commented on June 10, 2024

Ah! Good that you found out the issue!

from kcov.

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.