简介
随着写代码时间的增长,发现单元测试确实很有用。
这里推荐知乎回答陈萌萌关于gtest的回答
https://www.zhihu.com/question/27313846
先 占位, 以后有机会填坑。
gtest
github链接 https://github.com/google/googletest
因为openvolumesh 中使用了这个测试框架。
简单的测试结果
[==========] Running 74 tests from 4 test suites.
[----------] Global test environment set-up.
[----------] 39 tests from PolyhedralMeshBase
[ RUN ] PolyhedralMeshBase.CreateSimpleMesh
[ OK ] PolyhedralMeshBase.CreateSimpleMesh (2 ms)
[ RUN ] PolyhedralMeshBase.CreateSimpleMeshWithoutCells
---------------------------我的天空里没有太阳,总是黑夜,但并不暗,因为有东西代替了太阳。虽然没有太阳那么明亮,但对我来说已经足够。凭借着这份光,我便能把黑夜当成白天。我从来就没有太阳,所以不怕失去。
--------《白夜行》