嵌入式 C++ (ARM9) 上的单元测试 [英] Unit Testing on Embedded C++ (ARM9)

查看:29
本文介绍了嵌入式 C++ (ARM9) 上的单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我来自 Java 和 JUnit 的世界.我演示了 Hudson 以及我在那里使用 JUnit 取得的所有成果.我想在嵌入式设备上对 C++ 代码做同样的事情,但找不到从哪里开始.

I come from the world of Java and JUnit. I made a demonstration of Hudson and all what I achieve there with JUnit among other things. I would like to do the same with C++ code on an embedded device but can't find where to start.

工程是用iccarm.exe(IAR编译器)编译的,现在用romutil.exe把输出转成镜像文件刷到ARM9板上.

THe project is compiled with iccarm.exe (IAR compiler) Right now the output is converted into an image file using romutil.exe to be flashed to the ARM9 board.

我尝试按照本教程进行操作:http://netbeans.org/kb/docs/cnd/c-unit-test.html 但我在试图弄清楚如何将其移植到我的案例时遇到问题.

I tried to follow this tutorial: http://netbeans.org/kb/docs/cnd/c-unit-test.html but I'm having issues trying to figure out how to port it to my case.

  1. 我可以在设备外部对 C++ 代码运行单元测试吗?(即与 Hudson 一起收集报告等)
  2. 我可以将输出转换为 exe 吗?(看起来 Netbeans 希望它是)
  3. 什么是最适合我的案例的单元框架?(CppUnit、CUnit 等)

欢迎任何帮助/指导.

推荐答案

1) 您可以构建一个交叉编译器,然后使用交叉编译器代替 iccarm.exe.网上有很多关于如何使用 gcc 构建交叉编译器的教程.然后使用普通编译器为您的主机构建,而不是为目标构建(使用交叉编译器).

1) You could build a cross-compiler, and then instead of using iccarm.exe, use the cross compiler. There are lots of tutorials on the net how to build a cross compiler using gcc. Then instead of building for the target (using cross compiler) build for your host using normal compiler.

3) 随心所欲.cppunit、谷歌单元测试等

3) Whatever you like. cppunit, google unit tests, etc

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

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