-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# C++ project template with Google Tests and CI/CD | ||
|
||
This is a project template. Feel free to use it. It contains all pre-configured | ||
CMakeLists.txt, so to use it, just replace project name with your in | ||
[main CmakeLists.txt](CMakeLists.txt), and all target and executable names in | ||
[CI/CD script](./.github/workflows/ci_tests.yml). | ||
|
||
## How to run | ||
|
||
Run following commands from project directory. | ||
|
||
1. Create CMake cache | ||
|
||
```shell | ||
cmake -S . -B cmake-build | ||
``` | ||
|
||
2. Build main target | ||
|
||
```shell | ||
cmake --build cmake-build --target cpp_tests | ||
``` | ||
|
||
3. Build tests target | ||
|
||
```shell | ||
cmake --build cmake-build --target cpp_tests_tests | ||
``` | ||
|
||
4. Run main target | ||
|
||
* On Windows: | ||
|
||
```shell | ||
.\cmake-build\bin\cpp_tests.exe || .\cmake-build\bin\Debug\cpp_tests.exe | ||
``` | ||
|
||
* On POSIX: | ||
|
||
```shell | ||
.\cmake-build\bin\cpp_tests | ||
``` | ||
|
||
5. Run tests | ||
|
||
* On Windows: | ||
|
||
```shell | ||
.\cmake-build\bin\cpp_tests_tests.exe || .\cmake-build\bin\Debug\cpp_tests_tests.exe | ||
``` | ||
|
||
* On POSIX: | ||
|
||
```shell | ||
.\cmake-build\bin\cpp_tests_tests | ||
``` |