我不知道如何使单元测试与Boost和Eclipse一起使用. 根据放置源文件的位置,我会遇到很多不同错误.
I can't work out how to get unit testing to work with Boost and Eclipse. I get lots of different errors depending on where I put the source files.
应该去哪里考试? (即我应该在根目录,src目录中创建一个测试文件夹,还是根本没有文件夹)
Where are the tests supposed to go? (ie should I create a test folder in root, in src, no folder at all or what)
如果我不打算拥有main()并且仅进行大量测试,是否需要在某处指定某些内容?
Do I need to specify something somewhere if I don't intend to have a main(), and just lots of tests?
我真的很困惑,我知道我对细节很了解-希望您可以向我展示使用Eclipse中的Boost进行单元测试的正确方法,而不是我目前正在做的事情.
I'm really confused, and I know I'm being quite lite on the details - hopefully you can show me the proper way to do Unit Testing with Boost in Eclipse rather than whatever I'm currently doing.
推荐答案以eclipse的第一标准编译应用程序,而无需进行单元测试.
Compile your application in eclipse first normal without unit tests.
之后,创建一个新项目,并将其与您的应用程序一起引用到以前的项目. 比您创建一个main.cpp并在其中插入单元测试.
After that create a new Project and reference it to the former Project with your application. Than you create a main.cpp and insert your unit tests there.
您应该能够使用新项目中的其他项目类.因此,您可以实例化对象并执行您的断言或任何您喜欢的事情.如果您还有其他疑问,请发布您的实际错误并提供当前结构的屏幕截图.
You should be able to use the other projects classes from the new Project. Therefore, you are able to Instantiate Objects and do your asserts or whatever you like. If you have any further questions, please post your actual error and provide a screen-shot of your current structure.
更多推荐
使用Boost和Eclipse进行单元测试
发布评论