是谷歌测试确定测试C code吗? [英] Is Google Test OK for testing C code?

查看:104
本文介绍了是谷歌测试确定测试C code吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我来想享受使用谷歌试了C ++项目我参与,我只是带来了一个新的项目,将是直C(库),并至今无法看到任何理由不使用谷歌测试继续,尽管它的一个C ++框架。请准备一个C ++编译器将不再是一个问题。

So I've come to like and enjoy using Google Test for a C++ project I'm involved in. I'm just bringing up a new project that will be straight C (a library) and so far can't see any reason why not to continuing using Google Test, even though its a C++ framework. Having a C++ compiler available will not be an issue.

是否有为什么我不应该使用谷歌测试用于测试传统的C code特殊的理由?

Are there are specific reasons why I shouldn't use Google Test for testing straight C code?

感谢。

推荐答案

这是一个使用C ++测试框架,甚至的关于这个问题领先本书遵循这一做法。我在过去googletest广泛用于单元测试C code和可以推荐它。

It is pretty common to test C code using a C++ testing frameworks, even the leading book on the subject follows this approach. I have used googletest extensively in the past to unit test C code and can recommend it.

我已经写了一篇博客文章关于它可能有用:
<一href=\"http://meekrosoft.word$p$pss.com/2009/11/09/unit-testing-c-$c$c-with-the-googletest-framework/\">http://meekrosoft.word$p$pss.com/2009/11/09/unit-testing-c-$c$c-with-the-googletest-framework/

I have written a blog post about it that might be useful: http://meekrosoft.wordpress.com/2009/11/09/unit-testing-c-code-with-the-googletest-framework/

这篇关于是谷歌测试确定测试C code吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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