单元测试框架对于C [英] Unit Testing Frameworks for C

查看:109
本文介绍了单元测试框架对于C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  单元测试C code

我见过具体到C ++的一些问题,但我真的很好奇C.我想添加一个标准的单元测试框架到我们的构建环境。我的主要目标是鼓励我们的开发人员编写单元测试,规范的测试,以便其他人可以运行它们。理想情况下,我想作为我们每晚构建的一部分运行单元测试。

I've seen a few questions specific to C++, but I'm really curious about C. I'm trying to add a standard unit test framework into our build environment. My primary goals are to encourage our developers to write unit tests, and to standardize those test so others can run them. Ideally I'd like to run the unit tests as part of our nightly build.

我们开始与一些Cunit的工作,除了工作,一切都在一个线程中运行任何内存故障引起的单元测试停止运行,这是相当烦人。我还发现它非常难写测试,但是这可能只是你的单元测试。

We started some work with CUnit, which worked except that everything ran in one thread and any memory faults caused the unit tests to stop running, which was rather annoying. I also found it incredibly difficult to write the tests, but that might just be unit testing for you.

有谁知道良好的替代品?有没有人曾与C ++单元测试人员的经验与C-仅code?

Does anybody know of good alternatives? Has anybody had any experience with the C++ Unit Testers with C-only code?

推荐答案

我写嵌入使用C软件,我决定写我自己的框架。这是非常简单和MS Visual Studio中编写。它方便地移植到其他平台。

I write embedded software using C and I decided to write my own framework. It's very simple and written for MS Visual Studio. It's easily ported to other platforms.

的http://$c$c.google.com/p/cunitwin32/

如果你的目标的linux我想检查可能会适合您的需求。

If you're targeting linux I think Check might suite your needs.

这篇关于单元测试框架对于C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆