Googletest下载
github地址:GitHub - google/googletest: GoogleTest - Google Testing and Mocking Framework
找到release-1.8.1.tar.gz版本下载,因为后续版本需要c++11以上才能使用。
Googletest安装步骤
解压tar包
tar -xzvf 1.8.1.tar.gz
进入1.8.1文件夹编译gtest
mkdir build cmake .. make sudo make install
生成如下:
Qt中使用Googletest步骤
1.qt中新建项目选择Auto Test project
注意:在Googletest repository选择自己安装的1.8.1版本路径