DIFF.BLOG
New
Following
Discover
Jobs
More
Top Writers
Suggest a blog
Upvotes plugin
Report bug
Contact
About
Sign up  
cmocka单元测试框架
1
·
·
Nov. 7, 2019, midnight
Summary
cmocka是一个C语言的单元测试框架,仅依赖标准库,可以在多种平台多种编译器上使用。cmocka官网为https://cmocka.org/下载和编译cmocka的源码托管在GitLab上,编译系统使用CMake1234git clone https://gitlab.com/cmocka/cmocka.gitcd cmockamkdir build && cd buildcmake .. && make示例cmocka使用示例位于源码目录下的example文件夹中,example中演示了assert_macro、assert_module、allocate_module和mock的使用。测试用法simple_testsimple_test.c演示了cmocka最简单的使用方法。123456789101112131415161718#include <stdarg.h>#include <stddef.h>#include <setjmp.h>#include <stdint.h>#include <cmocka.h>// include cmocka header// test c...
Read full post on www.tiehichi.site →
Submit
AUTHOR
RECENT POSTS FROM THE AUTHOR