嵌入式 C++ 系统中的持续集成/单元测试 [英] Continuous Integration/ Unit testing in embedded C++ systems

查看:17
本文介绍了嵌入式 C++ 系统中的持续集成/单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪些工具通常用于单元测试,尤其是嵌入式系统的持续集成?

What tools are generally used for unit testing and especially continuous integration for embedded systems?

我特别认为您通常必须交叉编译和部署,并且您不能轻松地可视化目标平台.此外,运行测试代码和框架可能很困难.

I am especially thinking that you usually have to cross-compile and deploy, and also that you can't easily visualize the target platform. Also it can be difficult to run test-code and frameworks.

我还能用什么来缓解这些困难?

What could I use too alleviate these difficulties?

(我认为应该是某种双重目标,构建服务器在更简单的目标上运行测试)

(I think it should be some kind of dual targeting, where the build server runs its tests on a easier target)

推荐答案

对于单元测试,看看 Unity.http://sourceforge.net/apps/trac/unity/wiki它是 Ruby 脚本支持的真正轻量级测试工具(2 个 .h 和 1 个 .c 文件).我们一直在嵌入式 ARM7 目标系统中使用单元测试(通过串行端口重定向测试报告).CMock 也支持(惊喜,惊喜)Mocking.尽管不广泛,但它们的优点是它们非常易于使用.关于 CI,如果您是基于 Linux 的,那么 Hudson 非常好.还可以查看 CppUTest 并在 http://renaissancesoftware.net/ 上查看 James Grenning 的书嵌入式 C 的 TDD"

For unit testing, take a look at Unity. http://sourceforge.net/apps/trac/unity/wiki It is a really lightweight test harness (2 x .h and 1 x .c file) supported by Ruby scripts. We have been using in an embedded ARM7 target system for unit testing (redirecting test reporting over a serial port). It is also supported by CMock for (surprise, surprise) Mocking. Even though not extensive, the great thing about these is they are so easy to use. Regarding CI, then Hudson is very good if you're Linux based. Also look at CppUTest and check out James Grenning's book "TDD for Embedded C" at http://renaissancesoftware.net/

这篇关于嵌入式 C++ 系统中的持续集成/单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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