Boost库单元测试使用配置
1 Boost库简介
Boost官网:http://www.boost.org/。
中文简介见百度百科:http://baike.baidu.com/view/663725.htm。
Boost库是一个可移植、提供源代码的C++库,作为标准库的后备,是C++标准化进程的发动机之一。
Boost中比较有名气的几个库:
- Regex 正则表达式库。
- Pool 内存池管理。
- smart_ptr 5个智能指针,学习智能指针必读。
Boost学习书籍《Boost程序库完全开发指南》。
2 下载源文件
版本:Boost 1.48.0
地址:http://sourceforge.net/projects/boost/files/boost/1.48.0/
3 Bjam工具生成
参考:http://blog.csdn.net/great3779/article/details/6977922/
编译器:vs2005。
解压源文件到D:\boost_1_48_0
运行D:\boost_1_48_0\bootstrap.bat,生成bjam.exe。
4 编译Boost.test模块
Boost.test为单元测试模块,其他模块编译方式相同。
Test: Support for simple program testing, full unit testing, and for program execution monitoring, from Gennadiy Rozental.
静态库生成命令:bjam stage --toolset=msvc-8.0 --with-test link=static debug release
动态库生成命令:bjam stage --toolset=msvc-8.0 --with-test link=shared debug release
默认生成位置:
include paths:D:/boost_1_48_0
library paths:D:\boos