psycofdj / coverxygen Goto Github PK
View Code? Open in Web Editor NEWGenerate doxygen's documentation coverage report
License: GNU General Public License v3.0
Generate doxygen's documentation coverage report
License: GNU General Public License v3.0
Hi, coverxygen developers
I'm using doxygen together with coverxygen for document coverage report. The C++ project I'm using is big, containing many modules, thus header files are distributed in each module's own including directory.
Here comes the question, coverxygen's --src-dir
option does not support multiple directories?
Hi, coverxygen developers
I'm using doxygen together with coverxygen, lcov to generate document coverage report, for a very naive C++ header file.
It confuse me by considering #pragma once
as function, thus make wrong coverage percentage (25%, instead of expected 33%)
The source code I'm using is :
hello.h:
#pragma once
void nice();
void hello(const char* name);
/// @brief the int data version
void hello(int data);
The doxygen configuration file I'm using is
PROJECT_NAME = "MyProject"
EXTRACT_ALL = YES
HTML_TIMESTAMP = YES
RECURSIVE = YES
GENERATE_XML=YES
GENERATE_HTML=YES
GENERATE_LATEX=NO
GENERATE_LEGEND = YES
INPUT = /home/zz/work/test/doxygen_example3/src/hello.h
The commands to generate document coverage report is:
#!/bin/bash
doxygen Doxyfile.in
python -m coverxygen --xml-dir ./xml --src-dir ../src --output doc-coverage.info --kind function
rm doc-coverage.info
lcov --summary doc-coverage.info
genhtml --no-function-coverage --no-branch-coverage doc-coverage.info -o .
echo "python -m http.server 7088"
In our project we have to start every file with a copyright notice that looks like this:
/*
* Project name
* Copyright()...
* ...
*/
Coverxygen falsely produces a 0 count at the beginning of the comment.
This happens in every file with such comment.
A Markdown summary table output option would make this more easily usable in CI workflows by allowing the output to be piped directly to PR auto-comments.
Hi all!
Thanks to the doxy-coverage and coverxygen project members for all the time & effort that has been put into the projects.
I am currently evaluating the use of coverxygen - working with a C/C++ code base.
I hade some starting difficulties, so I am currently playing around with a reduced code sample. It basically seems to work.
My flow:
# change directory to coverxygen repository, then generate Doxygen documentation from my example in ./test/average
$ cd ./test/average/ && doxygen && cd ../..
# run coverxygen
$ python3 -m coverxygen --xml-dir ./test/average/doc/xml/ --output ./test/average/doc/average.info --output ./test/average/doc/coverage.info --src-dir ./test/average/
# output lcov
$ lcov --summary ./test/average/doc/coverage.info
Reading tracefile ./test/average/doc/coverage.info
Summary coverage rate:
lines......: 60.0% (3 of 5 lines)
functions..: no data found
branches...: no data found
# generate HTML report and view it in the browser
$ genhtml --no-function-coverage --no-branch-coverage ./test/average/doc/coverage.info -o ./test/average/doc/coverage
Reading data file ./test/average/doc/coverage.info
Found 2 entries.
Found common filename prefix "/mnt/somepath/coverxygen/test"
Writing .css and .png files.
Generating output.
Processing file average/average.cpp
Processing file average/doc/xml/todo.xml
Writing directory view page.
Overall coverage rate:
lines......: 60.0% (3 of 5 lines)
Undocumented functions are detected as expected.
Before:
After:
Where (if at all) can I exclude the check for #include
s, using
s and probably other keywords/expressions/statements?
Your README.md shows the following example:
summary Format
Classes : 90.5% (38/42)
Defines : 0.0% (0/2)
Enum Values: 12.3% (8/65)
Enums : 75.0% (3/4)
Files : 8.3% (2/24)
Functions : 64.8% (175/270)
Namespaces : 75.0% (6/8)
Pages : 100.0% (7/7)
Signals : 83.3% (5/6)
Slots : 28.6% (2/7)
Structs : 80.0% (4/5)
Typedefs : 39.1% (9/23)
Variables : 20.0% (8/40)
-----------------------------------
Total : 53.1% (267/503)
What needs to be done to get this detailed summary?
Can you also check if all parameters of a function/method have been commented?
Any help is very much appreciated.
I am using Doxygen to generate documentation for an application in Brazilian Portuguese and I want to check documentation coverage, but I am facing a bit of an odd error.
Some of the comments happen to make use of accents for that language. For example, "não" (Portuguese for "no") or "instruções" (for "instructions").
When I try to run coveryxgen, I receive the following error:
Command:
$ python3 -m coverxygen --xml-dir docs/xml/ --src-dir . --output -
error: error while parsing xml file docs/xml/.xml : not well-formed (invalid token): line 567, column 138
When I look at the XML file in the corresponding line and column I find one of those symbols (in the example above it was a c-cedil (ç), but a-tilde (ã) or a-acute (á) were also flagged. And there may be several others.
Hi,
This project looks great, thanks!
I tried it with doxygen output for a c# project and run into some issues where the coverage is not reflected correctly.
I was wondering if this is meant to be supported and if you could point me in the right direction?
Unfortunately I cannot share the project and didn't get around to creating a minimum reproducible example, but the two issues im seeing at first glance are:
EDIT: this is same as #15
I'd be happy to share more debug output, create a minimum example or test stuff or submit a PR if this project scope would include c# support.
Best,
wiktor
Hi,
I followed your instructions in the readme file. My problem is that the python module isn't generating any output. When I use
python3 -m coverxygen --xml-dir ./doc/xml --output doc-coverage.info
the doc-coverage.info file is generated, but it's empty. There isn't any log output or error message, so i have no idea how to fix that problem.
I am developing on Ubuntu 16.04 4.4.0-57-generic x86_64.
The python tool doxy-coverage by Alvaro Lopez Ortega works properly. I hope you have an idea how to fix this issue.
Thanks in advance
See codecov/support#364, in short coverxygen can be used to get doxygen coverage numbers on codecov.io by simply adding something like:
make doxygen
python -m coverxygen --xml-dir xml/ --src-dir . --output doxygen.coverage.info
bash <(curl -s https://codecov.io/bash) -R . -F doxygen -X gcov -f doxygen.coverage.info
Thanks a lot for this very useful tool!
I noticed that the output_print_lcov
method will produce negative execution counts in the lcov
output format when it encounters an undocumented object:
coverxygen/coverxygen/__init__.py
Line 226 in ce7e153
This results in output like the following:
...
DA:53,1
DA:49,1
DA:61,-1
DA:62,-1
DA:63,-1
DA:64,-1
DA:60,1
...
lcov (at least in version 1.13) will process the file properly, but complains:
lcov: WARNING: negative counts found in tracefile
The service codecov.io
on the other hand processes the output, but counts negative counts as covered, leading to an incorrect 100% coverage.
Replacing all counts of -1
in the output with 0
(e.g. with sed -i -e 's/,-1$/,0/g' <outputfile>
) causes the warning to disappear from the lcov
and genhtml
output while still producing the correct coverage report.
More importantly (at least for me), submitting the file with the counts set to 0
instead of -1
to codecov.io
results in the results being parsed correctly and the coverage information being available through codecov.io
.
I tried to install this, and it fails because there is not setuptools module
root@9c426af140c0:/usr/src/app# pip3 install coverxygen
Collecting coverxygen
Using cached coverxygen-1.3.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named 'setuptools'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-_8m3d7_m/coverxygen/
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
I was able to install it after installing setuptools
root@9c426af140c0:/usr/src/app# pip3 install setuptools
Collecting setuptools
Downloading setuptools-36.2.7-py2.py3-none-any.whl (477kB)
100% |################################| 481kB 2.1MB/s
Installing collected packages: setuptools
Successfully installed setuptools-36.2.7
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@9c426af140c0:/usr/src/app# pip3 install coverxygen
Collecting coverxygen
Using cached coverxygen-1.3.0.tar.gz
Building wheels for collected packages: coverxygen
Running setup.py bdist_wheel for coverxygen ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-z6ddhwqk/coverxygen/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmps3fokatxpip-wheel- --python-tag cp35:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
Failed building wheel for coverxygen
Running setup.py clean for coverxygen
Failed to build coverxygen
Installing collected packages: coverxygen
Running setup.py install for coverxygen ... done
Successfully installed coverxygen-1.3.0
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@9c426af140c0:/usr/src/app#
From a recent CI job:
E: The repository 'https://ppa.launchpadcontent.net/psycofdj/coverxygen/ubuntu jammy Release' does not have a Release file.
Although this may not be such a big deal to be reported as a "bug", it is a requirement to correctly describe package versioning in Archlinux AUR packages in an automated way. It would be a nice to have feature!
Thanks!
Hi,
I think it would be nice to have the option to check if all function parameters (and the return value?) of a function are documented. Currently, function parameter documentation seems to be ignored.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.