I'm using google unit testing code.
我正在使用谷歌单元测试代码。
I'm building it quite nicely with xcodebuild on the command line. Now I want to run it (preferably on attached Device but simulator would also work) and catch all the feedback from the tests.
我在命令行上使用xcodebuild很好地构建它。现在我想运行它(最好是在附加设备上,但模拟器也可以工作)并捕获测试的所有反馈。
But I can't find out how to run it. Any ideas?
但我无法找到如何运行它。有任何想法吗?
4 个解决方案
#1
Jeff Haynie's iphonesim project on Github looks like it could work. I had trouble building 27812bb4b (make
failed on a warning in nsprintf.m
), but that may just be me using a pre-release OS and SDK. See also this related question.
Jeff Haynie在Github上的iphonesim项目看起来可行。我在构建27812bb4b时遇到了麻烦(在nsprintf.m中发出警告失败),但这可能只是我使用预发布的操作系统和SDK。另请参阅此相关问题。
#2
If you followed the instructions from the Google page (creating the target, adding the test files to the target) and you have an iPhone SDK certificate (you need it to upload apps to the device) you can just change the Active SDK to your device (upper left corner combo in XCode)
如果您按照Google页面上的说明操作(创建目标,将测试文件添加到目标)并且您拥有iPhone SDK证书(您需要将其上传到设备),您只需将Active SDK更改为您的设备即可(XCode中的左上角组合)
If you don't have a certificate, you need to apply to the SDK program.
如果您没有证书,则需要申请SDK程序。
#3
The only iPhone simulator and debugger I'm aware of comes with the iPhone SDK. In order to use the iPhone SDK you need to have an Intel-based mac with OS 10.5 Leopard installed, in which case you might as well be programming/compiling in XCode instead of using the command line.
我知道唯一的iPhone模拟器和调试器附带iPhone SDK。要使用iPhone SDK,您需要安装基于Intel的Mac并安装OS 10.5 Leopard,在这种情况下,您也可以在XCode中编程/编译,而不是使用命令行。
#4
There has to be some misunderstanding here. What exactly do you want to run from the command line? The test suite? If so, the test suite should be a separate target, so that all you have to do is build it, for example like this:
这里必须有一些误解。你想从命令行运行到底是什么?测试套件?如果是这样,测试套件应该是一个单独的目标,所以你要做的就是构建它,例如:
xcodebuild -target UnitTests -sdk iphonesimulator2.2.1 -configuration Debug
If you have the testing target configured correctly, it will run the RunIPhoneUnitTest.sh
shipped with the Google Toolbox and the script will run all your tests.
如果您正确配置了测试目标,它将运行Google Toolbox附带的RunIPhoneUnitTest.sh,该脚本将运行您的所有测试。
#1
Jeff Haynie's iphonesim project on Github looks like it could work. I had trouble building 27812bb4b (make
failed on a warning in nsprintf.m
), but that may just be me using a pre-release OS and SDK. See also this related question.
Jeff Haynie在Github上的iphonesim项目看起来可行。我在构建27812bb4b时遇到了麻烦(在nsprintf.m中发出警告失败),但这可能只是我使用预发布的操作系统和SDK。另请参阅此相关问题。
#2
If you followed the instructions from the Google page (creating the target, adding the test files to the target) and you have an iPhone SDK certificate (you need it to upload apps to the device) you can just change the Active SDK to your device (upper left corner combo in XCode)
如果您按照Google页面上的说明操作(创建目标,将测试文件添加到目标)并且您拥有iPhone SDK证书(您需要将其上传到设备),您只需将Active SDK更改为您的设备即可(XCode中的左上角组合)
If you don't have a certificate, you need to apply to the SDK program.
如果您没有证书,则需要申请SDK程序。
#3
The only iPhone simulator and debugger I'm aware of comes with the iPhone SDK. In order to use the iPhone SDK you need to have an Intel-based mac with OS 10.5 Leopard installed, in which case you might as well be programming/compiling in XCode instead of using the command line.
我知道唯一的iPhone模拟器和调试器附带iPhone SDK。要使用iPhone SDK,您需要安装基于Intel的Mac并安装OS 10.5 Leopard,在这种情况下,您也可以在XCode中编程/编译,而不是使用命令行。
#4
There has to be some misunderstanding here. What exactly do you want to run from the command line? The test suite? If so, the test suite should be a separate target, so that all you have to do is build it, for example like this:
这里必须有一些误解。你想从命令行运行到底是什么?测试套件?如果是这样,测试套件应该是一个单独的目标,所以你要做的就是构建它,例如:
xcodebuild -target UnitTests -sdk iphonesimulator2.2.1 -configuration Debug
If you have the testing target configured correctly, it will run the RunIPhoneUnitTest.sh
shipped with the Google Toolbox and the script will run all your tests.
如果您正确配置了测试目标,它将运行Google Toolbox附带的RunIPhoneUnitTest.sh,该脚本将运行您的所有测试。