Automated C unit testing

早过忘川 提交于 2019-12-30 08:39:07

问题


I have a C library compiled with MinGW, Eclipse C project. Library consists of many modules, each module can be tested.

What is the best way (using MACROS or something) how to write tests for this library, compile it a run it in Eclipse/CDT IDE?

EDIT: I've seen that some people use

#ifdef TEST

int main(void)
{
   ...TEST LOGIC...
}
#endif

but don't know how to plug it into Eclipse.


回答1:


I'd suggest to use CuTest with a Makefile.



来源:https://stackoverflow.com/questions/6794999/automated-c-unit-testing

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