lib/xcov/model/report.rb in xcov-1.7.5 vs lib/xcov/model/report.rb in xcov-1.8.0
- old
+ new
@@ -56,10 +56,14 @@
targets = Report.filter_targets dictionary["targets"]
# Create target objects
targets = targets.map { |target| Target.map(target) }.sort { |lhs, rhs| lhs.name <=> rhs.name }
+ if !Xcov.config[:include_zero_targets]
+ targets = targets.select { |target| target.coverage > 0 }
+ end
+
Report.new(targets)
end
def self.filter_targets(targets)
filtered_targets = Array.new(targets)
@@ -71,10 +75,12 @@
if Xcov.config[:include_targets]
filtered_targets = filtered_targets.select { |target| self.included_targets.include?(target["name"])}
end
- supported_targets = Xcov.project.targets
+ filtered_targets = filtered_targets.select { |target| !target["files"].empty? }
+
+ supported_targets = Xcov.config[:is_swift_package] ? [] : Xcov.project.targets
if Xcov.config[:only_project_targets] && !supported_targets.empty?
filtered_targets = filtered_targets.select do |target|
name = target["name"]
name.slice! File.extname(name) # remove target extensions
supported_targets.include?(name)