- Create a simple calculator with GoogleTest
- Continuous Integration with GitHub Actions
Status | Build Type |
---|---|
windows-latest, ubuntu-latest, macos-latest | |
armv7 + ubuntu18.04, aarch64 + ubuntu18.04 | |
ubuntu-latest |
- To test core logic and input/output, make
Arithmetic
andPrompt
module, respectively Calculator
module contains these modules- However,
Calculator
module doesn't create these modules. Instead, use dependency injection- It's better to have a factory module, but in this project main function creates these modules to make it easy
- So that, I can use mock modules when running unit test for
Calculator
module
- main.cpp
- calculator/
- arithmetic/
- prompt/
- test/
- calculator/
- arithmetic/
- prompt/
mkdir -p build && cd build
cmake ..
make
ctest
./main
`>+ 1 2`
- Create Visual Studio project using cmake-gui
- Build the project
- Normal execution
- Set
main
as a startup project - Run
>+ 1 2
- Set
- Test
- Open Test Explorer
- Run All Tests
- gtest_test
- https://github.com/iwatake2222/gtest_test
- Copyright 2021 iwatake2222
- Licensed under the Apache License, Version 2.0
- This project utilizes OSS (Open Source Software)