OpenCppCoverage | OpenCppCoverage is an open source code coverage tool | Unit Testing library

 by   OpenCppCoverage C++ Version: release-0.9.9.0 License: GPL-3.0

kandi X-RAY | OpenCppCoverage Summary

kandi X-RAY | OpenCppCoverage Summary

OpenCppCoverage is a C++ library typically used in Testing, Unit Testing, Nodejs applications. OpenCppCoverage has no bugs, it has no vulnerabilities, it has a Strong Copyleft License and it has medium support. You can download it from GitHub.

OpenCppCoverage is an open source code coverage tool for C++ under Windows. The main usage is for unit testing coverage, but you can also use it to know the executed lines in a program for debugging purpose.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              OpenCppCoverage has a medium active ecosystem.
              It has 776 star(s) with 134 fork(s). There are 46 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 72 open issues and 85 have been closed. On average issues are closed in 73 days. There are 14 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of OpenCppCoverage is release-0.9.9.0

            kandi-Quality Quality

              OpenCppCoverage has 0 bugs and 0 code smells.

            kandi-Security Security

              OpenCppCoverage has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              OpenCppCoverage code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              OpenCppCoverage is licensed under the GPL-3.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              OpenCppCoverage releases are available to install and integrate.
              Installation instructions are available. Examples and code snippets are not available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of OpenCppCoverage
            Get all kandi verified functions for this library.

            OpenCppCoverage Key Features

            No Key Features are available at this moment for OpenCppCoverage.

            OpenCppCoverage Examples and Code Snippets

            No Code Snippets are available at this moment for OpenCppCoverage.

            Community Discussions

            QUESTION

            How do I generate PDB files using cmake and gcc?
            Asked 2021-Oct-19 at 19:00

            I want to use the OpenCppCoverage to check the coverage of my source files by my Unit Test. However, it seems that I need to have .pdb files generated for OpenCppCoverage to work.

            The problem is that I am not being able to generate such files from my build. Here is my CmakeLists.txt

            ...

            ANSWER

            Answered 2021-Oct-19 at 19:00

            I was able to figure out myself. So here is the answer if someone struggles with the same: gcc compiler is not able to generate .pdb files. What can be done is the following:

            1. Convert the debug information from gcc to pdb files using the converter called cv2pdb
            2. Use llvm/clange compiler that has support to generate .pdb
            3. Use another code coverage tool, such as gcov from gcc itself

            I decided to use option 3, and replace opencppcoverage by gcov (in fact I am using gcovr). I had to include the extra flags for coverage as mentioned above:

            Source https://stackoverflow.com/questions/69586973

            QUESTION

            Integrating C++ coverage with sonarqube
            Asked 2020-Dec-22 at 16:12

            I am using Google test framework for C++ unit tests. We are building our projects using MsBuild (runs on teamcity). Now, I want sonarqube to parse the coverage info. We have cfamily plugin in sonarqube. The compatible reports with cfamily plugin are bullseye, vscoverage, gcov, llvm-cov. As per my knowledge, because we can't use gcc for compiling, llvm-cov and gcov are ruled out. Since we are using googletest and also wants to run this on teamcity, vscoverage isn't possible. We aren't using Bullseye. (It is more for functional automation I am told).

            So I have decide to use OpenCppCoverage tool. This can generate coverage in cobertura format or generic format specified by sonarqube. I have tried generic format but sonarqube is ignoring the coverage for files but is parsing them successfully.

            Exploring more, I tried to use C++ community plugin(cxx). But I wasn't able to disable cfamily plugin so that C++ community can be used.

            So I want to know if I can do something else so that coverage of our C++ test projects can be parsed by sonarqube.

            ...

            ANSWER

            Answered 2020-Oct-27 at 13:33

            Did you try sonar-cxx plug-in from SonarOpenCommunity. This plugin adds C++ support to SonarQube. It's free plug-in and availble with LGPL-3.0 License.

            Source https://stackoverflow.com/questions/64555248

            QUESTION

            Show code coverage with a source code in Jenkins wiht Cobertura (run result from other machine)
            Asked 2020-Jan-31 at 13:28
            Background

            I have large c++ application with complex directory structure. Structure is so deep that code repository can't be stored in Jenkins workspace, but is some root directory, otherwise build fails since path length limit is busted.

            Now since application is tested in different environments, test application is run in diffrent machine. Application and all resources are compressed and copied to test machine where tests are run using OpenCppCoverage and as a result Cobertura xml is produced.

            Now since source code is needed to show covarage result xml is copied back to build machine and then feed to Jenkins Cobertura plugin.

            Problem

            Coverage reports shows only percent results for module or source code. Code content is not show, but this error message is show:

            Source

            Source code is unavailable. Some possible reasons are:

            • This is not the most recent build (to save on disk space, this plugin only keeps the most recent build’s source code).
            • Cobertura found the source code but did not provide enough information to locate the source code.
            • Cobertura could not find the source code, so this plugin has no hope of finding it.
            • You do not have sufficient permissions to view this file.

            Now I've found this SO answear which is promising:

            The output xml file has to be in the same folder as where coverage is run, so:

            ...

            ANSWER

            Answered 2020-Jan-31 at 13:28

            Ok I've found reasons why I had a problems with this plugin.

            1. xml from openCppCoverage is just correct. No changes are needed here to make it work (as far as sources are there where pdb file points to). Sources outside Jenkins workspace are not the problem here. When I copied executable from build machine to test machine, then run tests with openCppCoverage and copied result back to build machine it is just fine.

            2. In job configuration any user which supposed to view code coverage has to have access to Job/workspace in security section. In my case I've enabled this for all logged in users. This covers last bullet point of error message.

            3. Most important thing: build must be successful. I mean form beginning to the end. Doesn't meter if step containing call to cobertura plugin was successful. If any step (even in the future step) fails then cobertura will not show code for this coverage run. In my case build job was failing since one of tests was timing out. This was caused by openCppCoverage overhead which slows down tests by factor 3. My script was detecting timeout and killing one of tests.

            I discovered that not successful build was a problem by accident. During experiments I noticed two cases when cobertura has shown source code:

            • I've rerun job and removed all steps but one responsible for publishing coloratura results
            • I run whole job such way it run a single test case which passed

            Not sowing coverage if build is not successful is reasonable (if test failed then most probably wrong branch of code has been taken), but UI should indicate that in different way.

            Conclusion

            This is great example how it is important to report errors to user with precise details what went wrong and why. I wasted at least whole weak to figure out what is actually wrong which bullet point of error message is actually my case. In fact error message from plugin doesn't cover all reasons of not showing the code.

            I will file report that plugin should give better explanation what went wrong.

            Source https://stackoverflow.com/questions/59842681

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install OpenCppCoverage

            OpenCppCoverage can be downloaded from here.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link