Comments (8)
The problem was that gcov was first run without the -p (preserve-paths) option by the build system and then with the option by cpp-coveralls. As a result 2 types of .gcov were generated: with and without full path. This seems to confuse cpp-coveralls.
from cpp-coveralls.
The issue is still present, I was looking at the CHANGED tab instead of the ALL tab. All 0 code headers are still marked at 0%.
from cpp-coveralls.
👍
from cpp-coveralls.
TLTR: cpp-coveralls is not to blame, it is the server that needs to be fixed.
cpp-coveralls sends only covered and uncovered lines, it is coveralls server that calculates the coverage ration per file.
Running cpp-coveralls on a toy example:
FROM ubuntu
RUN apt-get update
RUN apt-get install -y python-pip gcc git
RUN pip install cpp-coveralls
WORKDIR /home
RUN echo 'class C {}; ' > empty.hpp
RUN echo 'int f() { return 0; }' > main.hpp
RUN echo '#include "empty.hpp"' > main.cpp
RUN echo '#include "main.hpp"' >> main.cpp
RUN echo 'int main() { return 0; }' >> main.cpp
RUN g++ --coverage main.cpp && ./a.out
RUN coveralls --dryrun --verbose --gcov-options '\-lp'
Outputs (after formating) :
{ 'service_name': 'travis-ci',
'git': {...},
'source_files': [
{'source': u'int f() { return 0; }\n',
'name': 'main.hpp', 'coverage': [0]},
{'source': u'#include "main.hpp"\n int main() { return 0; }\n',
'name': 'main.cpp', 'coverage': [None, 1]}],
{'source': u'class C {}; \n',
'name': 'empty.hpp', 'coverage': [None]}],
'service_job_id': ''}
}
As you can see each line has a corresponding coverage: the number of time executed or None
if it is not an executable line.
See the official api documentation for more information about coveralls post format.
A file with 0 code line will be reported as a list of None
not as a 0% or 100% covered file. As a result this issue can not be fix in cpp-coveralls. The statistic generator (on coveralls server) has to change it's coverage rate algorithm.
from cpp-coveralls.
I sent an email to coveralls. I hope they will be able to change this annoying behaviour.
from cpp-coveralls.
@krocard Sorry for the late reply. This is a awesome work. Thank you so much!
from cpp-coveralls.
Thanks @eddyxu, I hope it will motivate coveralls to address this issue.
from cpp-coveralls.
It seems that it is now fixed. coveralls now correctly displays 0 relevant line files as 100% covered!
from cpp-coveralls.
Related Issues (20)
- ValueError: invalid literal for int() with base 10: '917*' HOT 3
- Where is args.lcov_file being set?
- unable to generate report
- pip install failure on ubuntu/trusty64 HOT 5
- Best method for implementing with Boost Unit Test Cases
- Cannot find files due to odd path creation HOT 1
- 0 of 0 relevant lines covered: am I not using correct arguments? HOT 2
- Exclusion regexps do not appear to work HOT 2
- Variable interpolation into shell commands is unsafe HOT 1
- Is this project dead? HOT 1
- circleci not supported HOT 1
- --include or --exclude options doesn't seem to work at all HOT 3
- FIleNotFoundError with invalid path HOT 1
- YAMLLoadWarning HOT 1
- Cannot open source file
- Failed to see coverage results on Coveralls HOT 1
- Deprecation warning due to invalid escape sequences
- FileNotFoundError for not existing file
- github actions not showing the correct files on coveralls website
- feature request: carryforward flags
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpp-coveralls.