您的位置:首页 > 编程语言 > C语言/C++

编译C语言单元测试框架CUnit库的方法

2016-06-13 13:41 288 查看
引用: http://blog.csdn.net/yygydjkthh/article/details/46357421

个人备忘使用

/*********************************************************************

 * Author  : Samson

 * Date    : 06/04/2015

 * Test platform:

 *              gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2

 *              GNU bash, 4.3.11(1)-release (x86_64-pc-linux-gnu)

 * *******************************************************************/

下载 CUnit-2.1-3.tar.bz2:

http://sourceforge.net/projects/cunit/

解压:

tar jxvf CUnit-2.1-3.tar.bz2

cd  CUnit-2.1-3

因为是使用GNU automake的

aclocal

autoheader 
autoconf 
automake

automake --add-missing

再次执行automake:

automake

configure.in:161: required file `./ltmain.sh' not found

以上的报错使用以下命令进行配置:

libtoolize --automake --copy --debug --force

查看是否生成了configure,执行:

./configure

查看是否生成了Makefile,若已有执行:

make

安装编译出的库:

sudo make install 

查看是否已经安装成功:

ls /usr/local/lib/libcunit.so

然后在此基础上,稍微修正了一下

aclocal

171 autoheader

172 autoconf

173 automake

174 automake --add-missing

175 automake

176 libtoolize --automake --copy --debug --force

177 ls

178 ./configure

179 make[有错]

180 automake --add-missing

181 ./configure

182 make

183 sudo make install

184 ls /usr/local/lib/libcunit.so

 

 

REF:

http://cunit.sourceforge.net/

http://blog.csdn.net/yygydjkthh/article/details/43197031
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: