@@ -1281,9 +1281,11 @@ The library itself consists of a single header file licensed under the MIT licen
-[**doctest**](https://github.com/onqtam/doctest) for the unit tests
-[**Doozer**](https://doozer.io) for [continuous integration](https://doozer.io/nlohmann/json) on Linux (CentOS, Raspbian, Fedora)
-[**Doxygen**](http://www.stack.nl/~dimitri/doxygen/) to generate [documentation](https://nlohmann.github.io/json/)
-[**fastcov**](https://github.com/RPGillespie6/fastcov) to process coverage information
-[**git-update-ghpages**](https://github.com/rstacruz/git-update-ghpages) to upload the documentation to gh-pages
-[**GitHub Changelog Generator**](https://github.com/skywinder/github-changelog-generator) to generate the [ChangeLog](https://github.com/nlohmann/json/blob/develop/ChangeLog.md)
-[**Google Benchmark**](https://github.com/google/benchmark) to implement the benchmarks
-[**lcov**](http://ltp.sourceforge.net/coverage/lcov.php) to process coverage information and create a HTML view
-[**libFuzzer**](http://llvm.org/docs/LibFuzzer.html) to implement fuzz testing for OSS-Fuzz
-[**OSS-Fuzz**](https://github.com/google/oss-fuzz) for continuous fuzz testing of the library ([project repository](https://github.com/google/oss-fuzz/tree/master/projects/json))
-[**Probot**](https://probot.github.io) for automating maintainer tasks such as closing stale issues, requesting missing information, or detecting toxic comments.
COMMAND genhtml --title "JSON for Modern C++" --legend --demangle-cpp --output-directory html --show-details --branch-coverage json.info.filtered.noexcept
COMMENT "Generating HTML report test/html/index.html"
A massively parallel gcov wrapper for generating intermediate coverage formats *fast*
The goal of fastcov is to generate code coverage intermediate formats *as fast as possible* (ideally < 1 second), even for large projects with hundreds of gcda objects. The intermediate formats may then be consumed by a report generator such as lcov's genhtml, or a dedicated front end such as coveralls. fastcov was originally designed to be a drop-in replacement for lcov (application coverage only, not kernel coverage).
Currently the only intermediate formats supported are gcov json format and lcov info format. Adding support for other formats should require just a few lines of python to transform gcov json format to the desired shape.
In order to achieve the massive speed gains, a few constraints apply:
1. GCC version >= 9.0.0
These versions of GCOV have support for JSON intermediate format as well as streaming report data straight to stdout
2. Object files must be either be built:
- Using absolute paths for all `-I` flags passed to the compiler
- Invoking the compiler from the same root directory
If you use CMake, you are almost certainly satisfying the second constraint (unless you care about `ExternalProject` coverage).
It is possible to reap most of the benefits of fastcov for GCC version <9.0.0and>= 7.1.0. However, there will be a *potential* header file loss of correctness.
`fastcov_legacy.py` can be used with pre GCC-9 down to GCC 7.1.0 but with a few penalties due to gcov limitations. This is because running gcov in parallel generates .gcov header reports in parallel which overwrite each other. This isn't a problem unless your header files have actual logic (i.e. header only library) that you want to measure coverage for. Use the `-F` flag to specify which gcda files should not be run in parallel in order to capture accurate header file data just for those. I don't plan on supporting `fastcov_legacy.py` aside from basic bug fixes.
## Benchmarks
Anecdotal testing on my own projects indicate that fastcov is over 100x faster than lcov and over 30x faster than gcovr:
Project Size: ~250 .gcda, ~500 .gcov generated by gcov
parser=argparse.ArgumentParser(description='A parallel gcov wrapper for fast coverage report generation')
parser.add_argument('-z','--zerocounters',dest='zerocounters',action="store_true",help='Recursively delete all gcda files')
# Enable Branch Coverage
parser.add_argument('-b','--branch-coverage',dest='branchcoverage',action="store_true",help='Include branch counts in the coverage report')
# Filtering Options
parser.add_argument('-s','--source-files',dest='sources',nargs="+",metavar='',default=[],help='Filter: Specify exactly which source files should be included in the final report. Paths must be either absolute or relative to current directory.')
parser.add_argument('-e','--exclude',dest='excludepost',nargs="+",metavar='',default=[],help='Filter: Exclude source files from final report if they contain one of the provided substrings (i.e. /usr/include test/, etc.)')
parser.add_argument('-i','--include',dest='includepost',nargs="+",metavar='',default=[],help='Filter: Only include source files in final report that contain one of the provided substrings (i.e. src/ etc.)')
parser.add_argument('-f','--gcda-files',dest='gcda_files',nargs="+",metavar='',default=[],help='Filter: Specify exactly which gcda files should be processed instead of recursively searching the search directory.')
parser.add_argument('-E','--exclude-gcda',dest='excludepre',nargs="+",metavar='',default=[],help='Filter: Exclude gcda files from being processed via simple find matching (not regex)')
parser.add_argument('-g','--gcov',dest='gcov',default='gcov',help='Which gcov binary to use')
parser.add_argument('-d','--search-directory',dest='directory',default=".",help='Base directory to recursively search for gcda files (default: .)')
parser.add_argument('-c','--compiler-directory',dest='cdirectory',default=".",help='Base directory compiler was invoked from (default: .) \
This needs to be set if invoking fastcov from somewhere other than the base compiler directory.')
parser.add_argument('-j','--jobs',dest='jobs',type=int,default=multiprocessing.cpu_count(),help='Number of parallel gcov to spawn (default: %d).'%multiprocessing.cpu_count())
parser.add_argument('-m','--minimum-chunk-size',dest='minimum_chunk',type=int,default=5,help='Minimum number of files a thread should process (default: 5). \
If you have only 4 gcda files but they are monstrously huge, you could change this value to a 1 so that each thread will only process 1 gcda. Otherise fastcov will spawn only 1 thread to process all of them.')
parser.add_argument('-l','--lcov',dest='lcov',action="store_true",help='Output in lcov info format instead of fastcov json')
parser.add_argument('-r','--gcov-raw',dest='gcov_raw',action="store_true",help='Output in gcov raw json instead of fastcov json')
parser.add_argument('-o','--output',dest='output',default="coverage.json",help='Name of output file (default: coverage.json)')
parser.add_argument('-q','--quiet',dest='quiet',action="store_true",help='Suppress output to stdout')