How to compile Google Test using IAR compiler for ARM

烈酒焚心 提交于 2019-12-05 02:59:33

问题


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.

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


回答1:


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.

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).

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.

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.

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!



来源:https://stackoverflow.com/questions/34258428/how-to-compile-google-test-using-iar-compiler-for-arm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!