Fetch the repository succeeded.
C/C++ unit test demo using Google Test deployed to Travis-CI with test coverage deployed to Coveralls.
This demo uses the approach presented by Craig Scott in https://crascit.com/2015/07/25/cmake-gtest/.
git clone https://github.com/bast/gtest-demo.git
cd gtest-demo
mkdir build
cd build
cmake ..
cmake --build .
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.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。