摘要
本文基于笔者的实际开发经验,言简意赅地讲解了C/C++单元测试框架gtest的主要使用方法和注意事项,并设计了若干可编译的精简示例,给出了运行效果图。既可以用作gtest的入门教程,也适合作为工作中的快速参考。
This paper gives a terse explanation of gtest,Google's open source C/C++ unit testing framework,focusing on its principal usage and common pitfalls.A handful of tiny yet compilable examples are provided with execution result snapshots.It's both suitable as a kick-start tutorial and a desktop reference.