如何使用用于ARM的IAR编译器编译Google Test [英] How to compile Google Test using IAR compiler for ARM

查看:558
本文介绍了如何使用用于ARM的IAR编译器编译Google Test的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用用于ARM的IAR编译器来编译Google Test Framework,但是我遇到了与缺少诸如pthread之类的系统库有关的困难.

I am trying to compile Google Test Framework using IAR compiler for ARM, but I face difficulties related to the lack of system libraries such as pthread.

有人能够使用用于ARM的IAR编译器来编译Google Framework吗?

Has anybody been able to compile Google Framework using IAR compiler for ARM?

推荐答案

过去几天,我一直在尝试使GoogleTest正常运行,以便可以使用模拟器在IAR中的ARM微控制器上执行单元测试,并且放弃了.如您所说,我遇到了IAR工具链中没有的线程和库之类的问题.

I have tried for the past few days to get GoogleTest to work so that I can perform unit testing on our ARM microcontroller in IAR using the simulator and I've given up. Like you stated, I was running into issues like threading and libraries that aren't available in the IAR toolchain.

相反,我们决定使用迄今已成功的另一个框架 CppUTest .它还提供了我们已经可以使用的模拟框架. CppUTest还可以使用GoogleMock模拟框架(我还没有尝试过).

Instead, we've decided to move forward using a different framework that we've had success with so far called CppUTest. It also offers a mocking framework which we've been able to use. There's also the ability for CppUTest to use the GoogleMock mocking framework (which I haven't tried yet).

我们已经证明我们能够通过GCC和IAR使用CppUTest,这使我们能够使用GCC提供的GCOV功能,然后切换到IAR编译器以验证代码是否可以针对我们的目标进行编译.

We've demonstrated that we're able to use CppUTest using GCC and IAR which allows us to use the GCOV capability provided by GCC but then switch over to the IAR compiler to verify the code will compile for our target.

我发现这本书是一个很好的参考: James W. Grenning 进行的嵌入式C的测试驱动开发.它将CppUTest和Unity都用于其单元测试框架示例.

A great reference that I found has been the book: Test Driven Development for Embedded C by James W. Grenning. It uses both CppUTest and Unity for their unit testing framework examples.

由于书中有示例,并且它可以完成到目前为止我们需要的所有工作,因此我们在CppUTest上可能还有很多其他的框架也可以使用.

There may be plenty of other frameworks out there that will work as well we settled on CppUTest since there's examples in the book and it does everything we've needed so far.

我知道这不是您要找的答案,但我希望它能有所帮助!

I know it isn't the answer you were looking for, but I hope it helps!

这篇关于如何使用用于ARM的IAR编译器编译Google Test的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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