从 Xcode 7 中的覆盖率统计信息中排除代码
Excluding code from coverage stats in Xcode 7
我在 Xcode 7.0 和 Objective C () 中启用了代码覆盖率统计并且运行良好。
是否可以标记一些源代码行以便它们被覆盖率报告忽略?如果我使用的是 lcov,那么我可以使用 LCOV_EXCL_START
和 LCOV_EXCL_END
标记(如 How to tell lcov to ignore lines in the source files),但 Xcode 无法识别这些标记。
Xcode 是否有替代机制来执行此操作?
Xcode7 及更高版本 (based on some forum posts), the coverage system uses LLVM's coverage generation and reporting mechanisms, the format for which is detailed at http://llvm.org/docs/CoverageMappingFormat.html。自 Xcode 9 起,此格式 不 支持任何排除行的方法 (或其他结构)。
生成的映射由 llvm-cov 导出为可使用的格式(txt 或 html),这也没有太多的排除机制。 llvm-cov does 有一些简单的阈值,仅报告 "greater than" 或 "less than" 线路和区域的覆盖率,但我怀疑这不完全是你想要的基于上述问题后
我在 Xcode 7.0 和 Objective C (
是否可以标记一些源代码行以便它们被覆盖率报告忽略?如果我使用的是 lcov,那么我可以使用 LCOV_EXCL_START
和 LCOV_EXCL_END
标记(如 How to tell lcov to ignore lines in the source files),但 Xcode 无法识别这些标记。
Xcode 是否有替代机制来执行此操作?
Xcode7 及更高版本 (based on some forum posts), the coverage system uses LLVM's coverage generation and reporting mechanisms, the format for which is detailed at http://llvm.org/docs/CoverageMappingFormat.html。自 Xcode 9 起,此格式 不 支持任何排除行的方法 (或其他结构)。
生成的映射由 llvm-cov 导出为可使用的格式(txt 或 html),这也没有太多的排除机制。 llvm-cov does 有一些简单的阈值,仅报告 "greater than" 或 "less than" 线路和区域的覆盖率,但我怀疑这不完全是你想要的基于上述问题后