我找到了一个名为"xctest"的命令行工具,它显然可以在你的项目中运行单元测试.此可执行文件位于此处
/Applications/Xcode.app/Contents/Developer/usr/bin/xctest
Run Code Online (Sandbox Code Playgroud)
当我尝试在我的xctest包上运行此可执行文件时,我正在使用:
$ ./xctest /Users/myusername/Library/Developer/Xcode/DerivedData/MyApp-abcdefghijklmnop/Build/Products/Debug/MyAppTests.xctest
Run Code Online (Sandbox Code Playgroud)
但是,我得到以下输出:
Test Suite '(null)' started at 2013-11-14 21:16:45 +0000
Test Suite '(null)' finished at 2013-11-14 21:16:45 +0000.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds
Run Code Online (Sandbox Code Playgroud)
据我所知,xctest没有手册页,但在命令行输入./xctest会产生:
Usage: xctest [--test Self | All | None | <TestCaseClassName/testMethodName>] <path of unit to be tested>
Run Code Online (Sandbox Code Playgroud)
特别是,我希望能够在测试类中测试一个特定的方法,这就是为什么我想使用这个xctest命令.
我确实看到有一种方法可以从命令行运行所有测试,如:
$ xcodebuild test -scheme MyApp
Run Code Online (Sandbox Code Playgroud)
这将运行所有单元测试并正常工作(我看到我的单元测试结果,与使用xctest时不同).但我对能够从命令行运行单个测试方法感兴趣,例如:
$ ./xctest --test MyAppTests/testExample /Users/myusername/Library/Developer/Xcode/DerivedData/MyApp-abcdefghijklmnop/Build/Products/Debug/MyAppTests.xctest
Run Code Online (Sandbox Code Playgroud) 我使用Xcode创建了一个机器人,以便在我的项目中进行持续集成。
我添加了一个触发器,以便在集成之前运行,在该触发器中尝试执行“ git lfs pull”,以便将大型文件提取到Xcode用于执行构建的临时目录中。
为了使集成成功,有什么办法可以使“ git lfs pull”起作用?
目前,我无法成功下载大文件。我的脚本如下所示:
#!/bin/bash
changeToRepo() {
cd ${XCS_SOURCE_DIR}/My-Project-Name
}
changeToRepo
/usr/local/bin/git-lfs pull
Run Code Online (Sandbox Code Playgroud)
但是,不会下载大文件,并且当我查看触发脚本的日志时,会看到以下输出。
Git LFS:(1个文件中的0个)0 B / 139.13 MB
Git LFS:(1个文件中的0个)0 B / 139.13 MB
无法检出文件git-lfs / 1.1.0(GitHub; darwin amd64; go 1.5.1; git 258acf1)git版本2.5.4(Apple Git-61)$ git-lfs pull无法检出文件
无法写入工作目录文件:打开媒体文件时出错。goroutine 66 [运行中]:github.com/github/git-lfs/lfs.Stack(0x0,0x0,0x0)/Users/rick/go/src/github.com/github/git-lfs/lfs/errors.go :557 + 0x80 github.com/github/git-lfs/commands.logPanicToWriter(0x89a1e8,0xc82002e018,0x896028,0xc82000e480)/Users/rick/go/src/github.com/github/git-lfs/commands/commands.go :184 + 0xf7f github.com/github/git-lfs/commands.logPanic(0x896028,0xc82000e480,0x0,0x0)/Users/rick/go/src/github.com/github/git-lfs/commands/commands.go :148 + 0x421 github.com/github/git-lfs/commands.handlePanic(0x896028,0xc82000e480,0x0,0x0)/Users/rick/go/src/github.com/github/git-lfs/commands/commands.go :123 + 0x4e github.com/github/git-lfs/commands.LoggedError(0x896028、0xc82000e480、0x548060、0x17、0x0、0x0、0x0)/Users/rick/go/src/github。