Cunit简介

本博客(http://blog.csdn.net/livelylittlefish )贴出作者(三二一@小鱼)相关研究、学习内容所做的笔记,欢迎广大朋友指正!

Content

1. What is CUnit?

2. What are the interfaces?

3. How to use CUnit framework?

4. An example

Appendix installation of CUnit

(1) install curses/ncurses

(2) install CUnit

 

1. Wha t is CUnit?

(1) CUnit is a system for writing, administering, and running unit tests in C.
(2) It is built as a static library which is linked with the user's testing code.
(3) CUnit uses a simple framework for building test structures, and provides a rich set of assertions for testing common data types.

2.
What are the interfaces?

There are some kinds of interfaces of CUnit for running tests and reporting results.

(1) Automated interface with xml output
(2) Basic interface with non-interactive output to stdout
(3) Interactive console interface
(4) Interactive console interface (*nix)
(5) Windows interface (not yet implemented)

 

3. How to use CUnit framework?

The following is the typical of steps for using CUnit framework.

(1) Write functions for tests (and suite init/cleanup if necessary)
(2) Initialize the test registry, by calling CU_initialize_registry()
(3) Add suites to the test registry, by calling CU_add_suite()
(4) Add tests to the suites, by calling CU_add_test()
(5) Run tests using an appropriate interface, e.g. by calling CU_console_run_tests()
(6) Cleanup the test registry, by calling CU_cleanup_registry()

 

4. test, suite, registry

 

 

Registry 1 个或多个 suite 构成;

suite 1<

  • 0
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值