linux 安装gtest 单元测试
2015-09-01 16:36
531 查看
Before you start make sure your have read and understood this
note from Google! This tutorial makes using gtest easy, but may introduce nasty
bugs.
note from Google! This tutorial makes using gtest easy, but may introduce nasty
bugs.
1. Get the googletest framework
$ wget https://github.com/google/googletest/archive/release-1.7.0.zip[/code]
Or get it by hand. I guess I won't manitain this little How-to, so if you stumbled
upon it and the links are outdated, feel free to edit it.
2. Unzip and build google test$ unzip gtest-1.7.0.zip $ cd gtest-1.7.0 $ ./configure $ makeThis step might differ from distro to distro, so make sure you copy the headers and libs in the correct directory. I accomplished this by checking where Debians
3. "Install" the headers and libs on your system.
former gtest libs were located. But I'm sure there are better ways to do this. Note:make installis dangerous and not supported$ sudo cp -a include/gtest /usr/include $ sudo cp -a lib/.libs/* /usr/lib/... and check if the GNU Linker knows the libs
4. Update the cache of the linker$ sudo ldconfig -v | grep gtest
If the output looks like this:libgtest.so.0 -> libgtest.so.0.0.0 libgtest_main.so.0 -> libgtest_main.so.0.0.0
, everything is fine.
gTestframework is now ready to use. Just don't forget to link your project against the library by setting-lgtestas
linker flag and optionally, if you did not write your own test mainroutine, the explicit-lgtest_mainflag.
From here on you might want to go to Googles documentation about the
framework to learn how it works. Happy coding!
相关文章推荐
- Linux chmod命令详解
- Linux LVM学习总结——放大LV容量
- 一 SSH 无密码登陆 & Linux防火墙 & SELinux关闭
- Linux系统sigaction函数的使用示例
- Linux makefile教程-详细易懂
- Linux下的利器——supervise
- Linux RHCS 基础维护命令
- 创建守护进程步骤与setsid() -- linux
- TQ2440 学习笔记—— 10、嵌入式编程基础知识【arm-linux-ld 选项】
- LINUX网卡(设置千兆网卡速度及模式)
- 提升linux 低延时 高吞吐量 性能的配置
- linux系统调用分析
- linux查看cpu信息
- Centos6.5 64位系统镜像定制过程
- Linux下搭建Eclipse+Maven的Hbase开发环境
- linux下拉取文件的方法
- Linux串口编程教程(一)——基础知识介绍
- centos 6.5 安装qt5.2
- Linux常用命令大全
- Linux学习记录(8)Linux基本权限设置