Code Coverage

Code coverage is a code instrumentation and data collection technique that describes the degree at which an application’s source code is run with respect to test suites.

Testing with GTest

Googletest is a cross-platform C++ test framework developed by Google based on the xUnit architecture with a plethora of features such as XML report generation, platform-neutral test code and test isolation.

test.cc
1
2
3
4
5
6
int main(int argc, char * argv[])
{
::testing::InitGoogleTest(&argc, argv);

return RUN_ALL_TESTS();
}

Build with Bazel

Bazel is a fast massively scalable build and testing tool with extensive capabilities similar to Maven and Gradle.

BUILDBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
cc_library(
name = "hello-greet",
srcs = ["hello-greet.cc"],
hdrs = ["hello-greet.h"],
)

cc_binary(
name = "hello-world",
srcs = ["hello-world.cc"],
deps = [
":hello-greet",
],
)

CMake Deep-dive

CMake is an open-source cross-platform building, testing and packaging tool that relies on compiler independent configuration files to generate native makefiles.

CMakeLists.txtCMakeLists.txt
1
2
3
cmake_minimum_required (VERSION 2.6)
project (Tutorial)
add_executable(Tutorial tutorial.cxx)
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×