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

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

问题描述

我正在尝试使用适用于 ARM 的 IAR 编译器编译 Google 测试框架,但我面临与缺少 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.

有没有人能够使用 IAR 编译器为 ARM 编译 Google 框架?

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!

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

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