What is the proper way to configure googletest with Xcode 4?

不想你离开。 提交于 2019-12-24 00:47:16

问题


I am following the instructions located at https://github.com/google/googletest/blob/master/googletest/docs/XcodeGuide.md to set up googletest to work with Xcode. However, these instructions seem to be written for Xcode 3. Many things that this article mentions have changed in Xcode 4. What is the proper way to get google test to work with Xcode 4?


回答1:


I suggest using the open source xcode-googletest in order to integrate also with Xcode Test Framework (XCTest)




回答2:


  1. Follow the instructions located at https://github.com/google/googletest/blob/master/googletest/docs/XcodeGuide.md to build the gtest.framework package.
  2. Create a new command line tool target.
  3. Copy the contents of the main.cpp file in the googletest framework into your new main.cpp file for your target. Your main function will kick off the google test.
  4. Execute the new target when you want to run your unit tests.


来源:https://stackoverflow.com/questions/12147000/what-is-the-proper-way-to-configure-googletest-with-xcode-4

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