代码覆盖范围已经适用于Swift吗? [英] Is code coverage already working for Swift?
问题描述
我正在尝试在Xcode 6 Beta 4上为Swift应用程序设置测试代码覆盖率。
我过去曾经能够将ObjectiveC与Xcode 5结合使用,但是我想我必须打电话 void __gcov_flush()
方法,以触发.gcda / .gcno文件的生成。
我将用于检测和代码覆盖的属性都设置为是
用于应用程序和测试目标。
但是运行测试后,当我查看以下内容:
DerivedData /一些子文件夹/我看到的所有i386文件都是以下类型的文件:
.d,.dia,.o,.swiftmodule等等,但是什么都没有表示代码覆盖率。
I am trying to setup test code coverage for a Swift application on Xcode 6 Beta 4.
I was able to do so in the past using ObjectiveC with Xcode 5, however I think I had to call the void __gcov_flush()
method, to trigger generation of the .gcda/.gcno files.
I set both properties for instrumentation and code coverage to YES
for the app and test targets.
However after running the tests, when I look in:
DerivedData/some subfolders/i386 all I see are files of type:
.d,.dia,.o,.swiftmodule and so on, but nothing that indicates code coverage.
因此,我有两个问题:
- 是否期望使用Xcode6 beta 4对Swift进行代码覆盖?
- 如果是,并且有必要先刷新gcov,我该如何从Swift中执行
?
谢谢
推荐答案
Xcode 6 Beta 4没有覆盖Swift的代码。 Apple上有一个开放的ID为17450338的问题。
Xcode 6 Beta 4 does not have code coverage for Swift working. There is an open Apple issue with id: 17450338 against it.
这篇关于代码覆盖范围已经适用于Swift吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!