Is it possible to get code coverage done by tests using google test framework?
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
Yes, You can club your Gtest Based application with support of Gcov/lcov. refer the documentation of lcov http://ltp.sourceforge.net/coverage/lcov.php
there is one linux test project utility available which does your job very easy and is very self-interpretative.
lcov
- a graphical GCOV front-endDownload from Ubuntu repo:
Use following commands in your build directory
Run the Application
Generate HTML Report
This will look something like - http://ltp.sourceforge.net/coverage/lcov/output/index.html
(Only works on Windows)
It seems this question is still active, so here's an additional option. I've just tested Google Tests on our code coverage solution (yes, I'm the author), which works on Visual Studio. The project can be found at: https://github.com/atlaste/CPPCoverage
Instructions: right-click project, run coverage. :-)
If you prefer an XML output (for CI), you can call the coverage executable manually.
Yes, I've successfully used both free (gcov) and commercial (CTC++) tools. No special steps are needed, just follow the documentation.
More details can be found in this blog http://googletesting.blogspot.dk/2014/07/measuring-coverage-at-google.html