Skip to content

EmergReanimator/gtest-demo-win32

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status License

gtest-demo

C/C++ unit test demo using Google Test with continuous integration provided by GitHub Actions and test coverage deployed to Coveralls.

How to build this demo

git clone https://github.com/bast/gtest-demo.git
cd gtest-demo
cmake -S. -Bbuild 
cmake --build build

Running the tests

Either using ctest:

$ cd build
$ ctest

Test project google-test-toehold/build
    Start 1: example.add
1/4 Test #1: example.add ......................   Passed    0.03 sec
    Start 2: example.c_add
2/4 Test #2: example.c_add ....................   Passed    0.01 sec
    Start 3: example.subtract
3/4 Test #3: example.subtract .................   Passed    0.02 sec
    Start 4: example.c_subtract
4/4 Test #4: example.c_subtract ...............   Passed    0.01 sec

100% tests passed, 0 tests failed out of 4

Label Time Summary:
unit    =   0.07 sec*proc (4 tests)

Total Test time (real) =   0.14 sec

Or directly using unit_tests:

$ cd build 
$ ./bin/Debug/unit_tests.exe

[==========] Running 4 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 4 tests from example
[ RUN      ] example.add
[       OK ] example.add (0 ms)
[ RUN      ] example.c_add
[       OK ] example.c_add (0 ms)
[ RUN      ] example.subtract
[       OK ] example.subtract (0 ms)
[ RUN      ] example.c_subtract
[       OK ] example.c_subtract (0 ms)
[----------] 4 tests from example (0 ms total)

[----------] Global test environment tear-down
[==========] 4 tests from 1 test suite ran. (1 ms total)
[  PASSED  ] 4 tests.

Acknowledgments

About

Unit test demo using Google Test.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CMake 56.2%
  • C++ 36.4%
  • C 7.4%