简体   繁体   English

编译CppUTest和类型转换错误

[英]Compiling CppUTest and typecast errors

I have never used any unit test framework with C++. 我从未在C ++中使用任何单元测试框架。 Now I took CppUTest version 3.6. 现在,我选择了CppUTest 3.6版。 I am trying to compile library according to README_InstallCppUTest.txt file: 我正在尝试根据README_InstallCppUTest.txt文件编译库:

./configure => OK ./configure =>确定

make => Not OK make =>不好

src/CppUTest/JUnitTestOutput.cpp:170:29: error: use of old-style cast [-Werror,-Wold-style-cast]

Shall I correct all of these compiling error or can I somehow skip the errors? 我应该纠正所有这些编译错误,还是可以以某种方式跳过这些错误? I know that g++ is symbolic link to clang in OSX. 我知道g ++是OSX中clang的符号链接。

Previously I tried to use gtest. 以前,我尝试使用gtest。 Basically it was very nice when making dummy test (eg EXPECT_EQ(1,1) ). 基本上,进行虚拟测试时非常好(例如EXPECT_EQ(1,1) )。 When I tried to test a class of normal production code, it was difficult to find how to use stubs or mocs. 当我尝试测试一类正常的生产代码时,很难找到如何使用存根或Mocs的方法。 So I decided to try CppUTest. 所以我决定尝试CppUTest。

Shall I correct all of these compiling error or can I somehow skip the errors? 我应该纠正所有这些编译错误,还是可以以某种方式跳过这些错误?

You may disable the warning (or remove -Werror - it turns all warnings into errors). 您可以禁用警告(或删除-Werror将所有警告变为错误)。

I assume you have downloaded the stable release, so you can try with the current Git Snapshot . 我认为您已经下载了稳定版,因此可以尝试使用当前的Git Snapshot However, this may not be stable. 但是,这可能不稳定。

Ok. 好。 If I change CppUTest framework code, can I then commit changes? 如果更改了CppUTest框架代码,是否可以提交更改?

You should frist check the current sources (link above). 您应该首先检查 当前来源 (上面的链接)。 If it's not fixed yet , it's always a good idea to contribute your fix to the project. 如果尚未 修复 ,将修复程序贡献给项目始终是一个好主意。

You can either file an issue or open a pull request for your fix. 您可以提出问题,也可以打开拉动请求以进行修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM