# ci_test_gtest **Repository Path**: ngtesting/ci_test_gtest ## Basic Information - **Project Name**: ci_test_gtest - **Description**: No description available - **Primary Language**: C++ - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2020-03-18 - **Last Updated**: 2024-01-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [![Build Status](https://travis-ci.org/bast/gtest-demo.svg?branch=master)](https://travis-ci.org/bast/gtest-demo/builds) [![Coverage Status](https://coveralls.io/repos/bast/gtest-demo/badge.png?branch=master)](https://coveralls.io/r/bast/gtest-demo?branch=master) [![License](https://img.shields.io/badge/license-%20BSD--3-blue.svg)](../master/LICENSE) # gtest-demo C/C++ unit test demo using [Google Test](https://code.google.com/p/googletest) deployed to [Travis-CI](https://travis-ci.org/bast/gtest-demo/builds) with test coverage deployed to [Coveralls](https://coveralls.io/r/bast/gtest-demo). - [Build and test history](https://travis-ci.org/bast/gtest-demo/builds) - [Code coverage](https://coveralls.io/r/bast/gtest-demo) - Licensed under [BSD-3](../master/LICENSE) This demo uses the approach presented by Craig Scott in https://crascit.com/2015/07/25/cmake-gtest/. ## How to build this demo ```bash git clone https://github.com/bast/gtest-demo.git cd gtest-demo mkdir build cd build cmake .. cmake --build . ``` ## Running the tests Either using `ctest`: ``` $ ctest 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`: ``` $ ./bin/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](https://github.com/massich). - Clean-up in CMake code thanks to [Claus Klein](https://github.com/ClausKlein). ## References - https://crascit.com/2015/07/25/cmake-gtest/