Linux环境下gtest-1.6.0的使用

1. 从http://code.google.com/p/googletest/ 下载最新的安装文件,我的是gtest-1.6.0.zip   
2. 解压: unzip gtest-1.6.0.zip
3. 安装使用:
    从1.5.0版本开始,放弃使用make install,来安装。我们可以根据README文件里的内容来了解安装方法。
    快速开始:进入make目录,直接make,看到生成了sample1_unittest文件,执行一下看看结果吧!
    在samples文件夹下有一些示例,耐心看一下,很容易就学会使用了。
4. 附录:我的测试环境
    在我的用户目录建立文件夹:gtest_dir,将gtest安装包的include文件夹全部拷贝过来。然后,新建lib文件夹,拷贝刚才在make目录下的gtest_main.a文件至此。
    要编写测试用例,可以自定义Makefile如下:(记得更改GTEST_DIR目录!)
 
# Points to the root of Google Test, relative to where this file is.
# Remember to tweak this if you move this file.
GTEST_DIR = /data/home/neilwu/gtest_dir

# Where to find user code.
USER_DIR = ./

# Flags passed to the preprocessor.
CPPFLAGS += -I$(GTEST_DIR)/include

# Flags passed to the C&#
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值