
Explore modern c++ development with bazel, googletest, and googlemock through hands-on demos of bazel builds, unit testing, and in-process mocks that avoid external calls.
Set up the demo by downloading and unzipping the modern underscore cpb dot zip, install Visual Studio Code, and configure Bazel, G++, and the C/C++ and Bazel extensions; open project.
Explore bazel, a multiplatform build system for c++ and java, and its skylark language. See how it manages dependencies, builds in the correct order, and runs tests with logs.
build a calculator library and main executable with bazel, wiring sources and headers, then run to print 1 plus 2 equals 3.
Learn how to structure a C++ library with Bazel: organize include and source directories, declare dependencies, manage visibility, and build a calculator library with a search bar.
Explore bazel build rules for a c++ library and tests, using regular expressions to include or exclude files, and wire google test and google mock dependencies.
Dive into gtest with a deep look at factorial testing, building a simple math library, and exploring assertions, test cases, and regular expressions to validate outcomes.
Explore data-driven testing with gtest part 3: generate data using range, values, and combinatorial generators, use test with param, migrate from legacy code, and extend with custom lifecycle listeners.
Explore building a C++ project with bazel that lists files matching a regex, using io tools and a get_files routine, compiled with C++17 and filesystem support.
Explore unit testing with Google Test and Google Mock by building mocks, delegating calls, and validating call counts, order independence, and dummy data without touching the file system.
Explore how nice and strict mocks control warnings and default returns in googlemock, verify expect_call patterns, and use will, will once, and retirement to manage the order of mock responses.
Bazel is a build system from google. C++ is one of the languages that bazel supports.
One of the nice things about bazel is, you specify the files and bazel figures out the dependency tree.
Bazel is written in skylark (a subset of python) which makes it accessible to a wide audience.
The ability to integrate with other libraries and the build performance makes bazel a great choice to use.
Googletest is an industry wide accepted solution for unit testing. It's battle tested across multiple projects at varying scales in the industry.
This framework is built along lines of other popular frameworks like junit (following the xunit principles)
Googlemock is a framework for stubbing external calls to make your unit tests repeatable in isolation.
Looking forward to seeing you in the course.
Cheers.