Unit Testing and TDD
- Type of tests
- What is a unit test
- Write F.I.R.S.T. tests
- Structure of a unit test
- Given-when-then style
- What is test driven development (TDD)
Installation and Compilation of Google Test
- GTest at GitHub
- Download and building gtest explictly
- Downloading and building automatically using CMake
- Configuration of CLion to run gtest
Writing Test Functions
- Using the gtest test driver
- Writing a TEST() function
- Failing a test
- Expectations vs. assertions
- Relational checks
- Checking strings and native strings
- Checking for thrown exceptions
- Checking floating-point results
Test Fixtures
- Test life-cycle
- Defning a fixture class
- Setup and teardown operations
- Handling fixture data
Parameterized Tests
- Setting up a value-parameterized test
- Parameter value generators
- Setting up type-parameterized test
- Different ways to instantiate parameterized tests
- Type fixtures
Death Tests
- Checking for abnormal program termination
- Death test checks
- Death test predicates
- Checking for non-zero exit code
- Checking for raised signals such as SIGSEGV or SIGFPE
Command-Line Usage
- Running gtest on the command-line or inside a shell script
- Selection a sub-set of the tests to run
- Sample test filters
- Repeated tests
- Disabling selected tests
- Generating XML output for further post-processing
Life-Cycle Methods
- Runing code before and after test each test-function
- Runing code before and after test each test-group
- Runing code before and after test each test-suite
Mock Objects
- How to deal with dependent object that is not the target for a test
- Using fake objects
- What is a mock object
- Setting up Google Mock (gmock)
- Setting up a test using mock objects
Overview of Other Test Frameworks
- Google Benchmark
- Catch2
- Doctest
- CppUnit