This project demonstrates basic unit testing in C++ using Google Test.
.
├── Example.hpp # Header file with multiply function declaration
├── Example.cpp # Implementation of multiply function
├── test/
│ ├── ExampleTests.cpp # Google Test test cases
│ └── CMakeLists.txt # Test build configuration
├── CMakeLists.txt # Top-level build configuration
- CMake (version 3.14 or higher recommended)
- A C++ compiler supporting C++17
- Internet connection (to download Google Test automatically)
mkdir build
cd build
cmake ..
make
ctest --output-on-failureThis will build the project and run the tests, showing detailed output for any failed tests.
The tests cover the multiply(int a, int b) function, verifying behavior with positive, zero, and negative inputs.
This project is for learning purposes only.