Skip to content

My example project with GoogleTest framework. Also, the project has automated cross-platform build via Github Actions.

Notifications You must be signed in to change notification settings

kuznetsov-m/learn_gtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testing

App cli keys

--shape=[circle, rectangle, triangle] [int values]

example:
--shape=circle [radius_int_value]
--shape=rectangle [a_int_value] [b_int_value]
--shape=triangle [a_int_value] [h_int_value]

CMake build

  1. create build dir
  2. exec from build dir cmake ..
  3. cmake --build . or make
  4. from VSCode Command Palette CMake: Run Tests or from terminal CTest
  5. check compiled program ./my_program

Notes

Since gtest is intended for testing libraries (we cannot test code from an executable project). Then all the methods for the application were moved to the example_lib library.

gtest_force_shared_crt - googletest variable (check it in CMakeCache)

run one of tests (not working for me on mac):

./test/ExampleTests --gtest_filter=ExampleTests2*

Links

About

My example project with GoogleTest framework. Also, the project has automated cross-platform build via Github Actions.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published