Skip to content

selyunin/gtest_submodule

Repository files navigation

Cmake + googletest (git submodule) + Github actions

A toy project showcasing the following features:

In short, you see a C++ project that uses google test as a git submodule and integrates a Github CI pipeline (which in Github-terms is called Github actions).

Initially the pipeline run on travis CI. In October 2022 I updated the repo to use Github Actions instead.

I was inspired by the projects from the acknowledgement section, and at the sime time want improve on that: the goal is to use git submodules in order to avoid copying google test in the current repo.

Directory structure

Cloning the project

Use git clone --recursive ... to download the project and its git submodules. Otherwise from the project root repository one needs to download the submodules: git submodule update --init.

Building the project

  1. Creating the executables follows standard cmake procedure:
cmake -B build
  1. Compile the code (it will also compile the gtest for the first time):
cmake --build build
  1. Run executable:
./build/project1
  1. Cmake supports add_test function, then the tests can be launch make test or ctest commands.
./build/runUnitTests

alternatively, in the build directory, run:

ctest

Acknowledgement

The acknowledgments go to:

Maintainer

Dr. Konstantin Selyunin, for suggestions/questions/comments please contact: selyunin [dot] k [dot] v [at] gmail [dot] com

About

CPP Project with Google test submodule and Github Actions

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published