gpt4 book ai didi

xcodebuild 测试未运行 XCTestCase 单元测试文件

转载 作者:行者123 更新时间:2023-12-03 21:29:51 24 4
gpt4 key购买 nike

无法使用 xcodebuild test -scheme DollarTests -project Dollar.xcodeproj -configuration Debug -sdk macosx 运行单元测试文件

下面是命令的输出

xcodebuild test -scheme DollarTests -project Dollar.xcodeproj -configuration Debug -sdk macosx
Build settings from command line:
SDKROOT = macosx10.9

2014-06-14 16:43:29.537 xcodebuild[3504:92734] stream error: stream error at offset 29: created by an unsupported XCDependencyGraph build
2014-06-14 16:43:29.540 xcodebuild[3504:92735] stream error: stream error at offset 29: created by an unsupported XCDependencyGraph build
=== BUILD TARGET Dollar OF PROJECT Dollar WITH CONFIGURATION Debug ===

Check dependencies
warning: no rule to process file '/Users/ankur/Personal/Dollar/Dollar/Dollar.swift' of type text for architecture x86_64
OS X deployment target '10.10' for architecture 'x86_64' and variant 'normal' is greater than the maximum value '10.9' for the OS X 10.9 SDK.

=== BUILD TARGET DollarTests OF PROJECT Dollar WITH CONFIGURATION Debug ===

Check dependencies
warning: no rule to process file '/Users/ankur/Personal/Dollar/DollarTests/DollarTests.swift' of type text for architecture x86_64
warning: no rule to process file '/Users/ankur/Personal/Dollar/DollarTests/CarExample.swift' of type text for architecture x86_64
OS X deployment target '10.10' for architecture 'x86_64' and variant 'normal' is greater than the maximum value '10.9' for the OS X 10.9 SDK.

Test Suite 'All tests' started at 2014-06-14 20:43:30 +0000
Test Suite 'All tests' finished at 2014-06-14 20:43:30 +0000.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds
** TEST SUCCEEDED **

出于某种原因,它无法获取 XCTestCase 文件,我收到以下警告

warning: no rule to process file '/Users/ankur/Personal/Dollar/DollarTests/DollarTests.swift' of type text for architecture x86_64
warning: no rule to process file '/Users/ankur/Personal/Dollar/DollarTests/CarExample.swift' of type text for architecture x86_64

测试文件在 Swift 中,因此问题所在以及如何解决它以包含这些文件并在运行测试时运行这些文件。

附上我在项目中的配置和文件的截图

enter image description here

enter image description here

最佳答案

我在从命令行构建项目时遇到了同样的问题。问题可能是命令行工具配置为使用 Xcode 6 之前的版本。我的配置就是这种情况。

在我的例子中,我跑了

xcodebuild -version

它返回了以下内容:

Xcode 5.1.1 Build version 5B1008

然后我转到 Xcode 首选项,如下所示,选择版本 6 命令行工具,问题就消失了。

enter image description here

之后您可以使用确认命令行工具版本

xcodebuild -version

你应该回来

Xcode 6.0 Build version 6A267n

或类似的值,具体取决于您当前安装的测试版。

关于xcodebuild 测试未运行 XCTestCase 单元测试文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24224193/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com