using gtest with xcode

人盡茶涼 提交于 2020-01-05 10:12:46

问题


I'm trying to set up a c++ unit testing library on my computer and figured that google's gtest would be a good fit.

I am currently running mountain lion with the most recent release of xcode.

I have been attempting to follow the instructions found here but am running into an intresting problem.

I am opening the gtest project, building it, and even though xcode tells me that the build was successful, I cant seem to find the framework anywhere. any help on this subject would be highly appreciated!

Thank you!


回答1:


This worked for me:

  1. Get the code from https://github.com/dmonopoly/gtest-cmake-example
  2. Run the cmake GUI in the usual way (I used version 3.0.0). Hit "Configure", one of the prompts allows you to choose XCode generation. Hit configure again, Enable the "test" config option, hit configure again (and maybe even once again), then hit "Generate".

You should now be able to find the XCode project in the build directory that you specified. Open that project, and you will find the gtest source code, some demo test code, as well as a target for running the tests.



来源:https://stackoverflow.com/questions/19104922/using-gtest-with-xcode

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