c++ Autotools Google测试框架
C++ Autotools Google test framework
我正在尝试使用autotools将Google测试框架添加到我的应用程序。但是我有一些奇怪的错误。在configure.ac:
AC_CHECK_HEADER([gtest/gtest.h], [AC_DEFINE([HAVE_GTEST_H], 1)])
但是在log中我得到:
...
checking for limits.h... yes
checking gtest/gtest.h usability... no
checking gtest/gtest.h presence... no
checking for gtest/gtest.h... no
config.log:
configure:3276: checking gtest/gtest.h presence
configure:3276: gcc -E conftest.c
In file included from conftest.c:19:0:
/usr/include/gtest/gtest.h:54:18: fatal error: limits: No such file or directory
compilation terminated.
两个文件都存在。我知道/usr/include是默认的include
<limits>
是一个c++头,这可能意味着gtest.h
是一个c++头,这意味着谷歌测试框架是用c++编写的。您需要使用c++编译器来检测头文件的可用性。
关于如何使用autotools解决这个问题的详细信息,请参阅答案
相关文章:
- GoogleMock是否仍然打算与任何测试框架一起使用?
- 在C++中使用 Catch 测试框架编译错误"error: expected ';' at end of declaration list"
- 如何在提升构建中设置环境变量以进行提升单元测试框架?
- 使用 gtest 框架在单元测试代码中检查目标对象的私有变量的最佳实践是什么?
- 如何在自动工具C++中添加提升单元测试框架
- 如何在Qt测试框架中对信号进行基准测试?
- 如何使用Boost单元测试框架测试Qt应用程序
- 在 Linux 上构建 cpptest 单元测试框架
- 使用C 单元测试框架集成测试Java应用程序
- Visual Studio 2017 C 本地单元测试框架不起作用
- 在Google测试框架中,如何期望函数调用或其他功能调用
- 每次捕获测试框架较长的链接时间
- C 单元测试框架具有类型和值参数化
- CMAKE Boost 单元测试框架在 Mac 上不起作用
- 如何使用gmock框架模拟c++单元测试中的fork和execlp系统调用
- Google 测试框架 - 测试用例之间的依赖关系
- 如何使用Google测试框架测试共享库
- 使用CATCH C++单元测试框架测试两个std::向量是否相等
- 使用googletest (Google c++测试框架)测试C代码
- 使用Catch框架测试C++模板类