Skip to content

blindahl/gtest-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status License

gtest-demo

C/C++ unit test demo using Google Test deployed to Travis-CI with test coverage deployed to Coveralls.

How to build this demo

git clone --recursive https://github.com/bast/gtest-demo.git
cd gtest-demo
mkdir build
cd build
cmake ..
make

Running the tests

Either using make test:

$ make test

Running tests...
Test project /home/user/gtest-demo/build
    Start 1: unit
1/1 Test #1: unit .............................   Passed    0.00 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.00 sec

Or directly using unit_tests:

$ ./unit_tests

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

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

Acknowledgments

Container Travis setup thanks to Joan Massich.

About

Unit test demo using Google Test.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CMake 59.0%
  • C++ 41.0%