cppunit下载地址:https://www.freedesktop.org/wiki/Software/cppunit/
在linux终端安装:
git clone git://anongit.freedesktop.org/git/libreoffice/cppunit/
安装配置:
cd cppunit
./autogen.sh
./configure
make
make check # optional
make instal
gtest下载地址:mirrors / google / googletest · GitCode
在linux终端安装:
git clone https://github.com/google/googletest.git
下载成功后切换至googletest目录
执行命令:cmake .
make
如果此过程报错,可在CMakeLists.txt中添加如下语句再从第3步开始执行:SET(CMAKE_CXX_FLAGS “-std=c++11”)
在lib目录下会生成如下文件:libgmock.a libgmock_main.a libgtest.a libgtest_main.a
执行以下命令,完成安装:make install