slather 2.6.0 → 2.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.travis.yml +2 -0
  4. data/CHANGELOG.md +70 -0
  5. data/assets/slather.css +2 -1
  6. data/lib/slather/command/coverage_command.rb +1 -1
  7. data/lib/slather/coverage_file.rb +1 -1
  8. data/lib/slather/coverage_service/coveralls.rb +73 -6
  9. data/lib/slather/coverage_service/html_output.rb +51 -2
  10. data/lib/slather/profdata_coverage_file.rb +42 -2
  11. data/lib/slather/project.rb +38 -6
  12. data/lib/slather/version.rb +1 -1
  13. data/slather.gemspec +2 -2
  14. data/spec/fixtures/FixtureFramework/FixtureFramework.h +19 -0
  15. data/spec/fixtures/FixtureFramework/FlashExperiment.swift +7 -0
  16. data/spec/fixtures/FixtureFramework/Info.plist +24 -0
  17. data/spec/fixtures/FixtureFrameworkTests/FixtureFrameworkTests.swift +34 -0
  18. data/spec/fixtures/FixtureFrameworkTests/FlashExperimentTests.swift +9 -0
  19. data/spec/fixtures/FixtureFrameworkTests/Info.plist +22 -0
  20. data/spec/fixtures/cobertura.xml +157 -37
  21. data/spec/fixtures/fixtures.xcodeproj/project.pbxproj +222 -0
  22. data/spec/fixtures/fixtures.xcodeproj/xcshareddata/xcschemes/fixtures.xcscheme +21 -5
  23. data/spec/fixtures/fixtures.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  24. data/spec/slather/coverage_service/cobertura_xml_spec.rb +1 -1
  25. data/spec/slather/coverage_service/html_output_spec.rb +2 -2
  26. data/spec/slather/coverage_service/json_spec.rb +1 -1
  27. data/spec/slather/coverage_service/llvm_cov_spec.rb +1 -1
  28. data/spec/slather/coverage_service/sonarqube_xml_spec.rb +1 -1
  29. data/spec/slather/profdata_coverage_spec.rb +16 -0
  30. data/spec/slather/project_spec.rb +10 -6
  31. metadata +23 -9
@@ -26,7 +26,18 @@
26
26
  buildConfiguration = "Debug"
27
27
  selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
28
  selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
- shouldUseLaunchSchemeArgsEnv = "YES">
29
+ shouldUseLaunchSchemeArgsEnv = "YES"
30
+ codeCoverageEnabled = "YES"
31
+ onlyGenerateCoverageForSpecifiedTargets = "YES">
32
+ <CodeCoverageTargets>
33
+ <BuildableReference
34
+ BuildableIdentifier = "primary"
35
+ BlueprintIdentifier = "B1E6980125F96B670086A3E2"
36
+ BuildableName = "FixtureFramework.framework"
37
+ BlueprintName = "FixtureFramework"
38
+ ReferencedContainer = "container:fixtures.xcodeproj">
39
+ </BuildableReference>
40
+ </CodeCoverageTargets>
30
41
  <Testables>
31
42
  <TestableReference
32
43
  skipped = "NO">
@@ -39,8 +50,6 @@
39
50
  </BuildableReference>
40
51
  </TestableReference>
41
52
  </Testables>
42
- <AdditionalOptions>
43
- </AdditionalOptions>
44
53
  </TestAction>
45
54
  <LaunchAction
46
55
  buildConfiguration = "Debug"
@@ -61,8 +70,6 @@
61
70
  ReferencedContainer = "container:fixtures.xcodeproj">
62
71
  </BuildableReference>
63
72
  </MacroExpansion>
64
- <AdditionalOptions>
65
- </AdditionalOptions>
66
73
  </LaunchAction>
67
74
  <ProfileAction
68
75
  buildConfiguration = "Release"
@@ -70,6 +77,15 @@
70
77
  savedToolIdentifier = ""
71
78
  useCustomWorkingDirectory = "NO"
72
79
  debugDocumentVersioning = "YES">
80
+ <MacroExpansion>
81
+ <BuildableReference
82
+ BuildableIdentifier = "primary"
83
+ BlueprintIdentifier = "8C9A202C195965F10013B6B3"
84
+ BuildableName = "libfixtures.a"
85
+ BlueprintName = "fixtures"
86
+ ReferencedContainer = "container:fixtures.xcodeproj">
87
+ </BuildableReference>
88
+ </MacroExpansion>
73
89
  </ProfileAction>
74
90
  <AnalyzeAction
75
91
  buildConfiguration = "Debug">
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>IDEDidComputeMac32BitWarning</key>
6
+ <true/>
7
+ </dict>
8
+ </plist>
@@ -45,7 +45,7 @@ describe Slather::CoverageService::CoberturaXmlOutput do
45
45
  fixtures_project.post
46
46
 
47
47
  filepath = "#{fixtures_project.output_directory}/cobertura.xml"
48
- expect(File.exists?(filepath)).to be_truthy
48
+ expect(File.exist?(filepath)).to be_truthy
49
49
 
50
50
  FileUtils.rm_rf(fixtures_project.output_directory)
51
51
  end
@@ -185,8 +185,8 @@ describe Slather::CoverageService::HtmlOutput do
185
185
  end
186
186
 
187
187
  allow(fixtures_project).to receive(:input_format).and_return("profdata")
188
- allow(fixtures_project).to receive(:profdata_llvm_cov_output).and_return("./spec/fixtures/fixtures/other_fixtures.m:
189
- 1| |//
188
+ allow(fixtures_project).to receive(:pathnames_per_binary).and_return([{"filename" => Pathname.new("./spec/fixtures/fixtures/other_fixtures.m"), "segments" => []}])
189
+ allow(fixtures_project).to receive(:profdata_llvm_cov_output).and_return("1| |//
190
190
  2| |// other_fixtures.m
191
191
  3| |// fixtures
192
192
  4| |//
@@ -35,7 +35,7 @@ describe Slather::CoverageService::JsonOutput do
35
35
  fixtures_project.post
36
36
 
37
37
  filepath = "#{fixtures_project.output_directory}/report.json"
38
- expect(File.exists?(filepath)).to be_truthy
38
+ expect(File.exist?(filepath)).to be_truthy
39
39
 
40
40
  FileUtils.rm_rf(fixtures_project.output_directory)
41
41
  end
@@ -38,7 +38,7 @@ describe Slather::CoverageService::LlvmCovOutput do
38
38
  fixtures_project.post
39
39
 
40
40
  filepath = "#{fixtures_project.output_directory}/report.llcov"
41
- expect(File.exists?(filepath)).to be_truthy
41
+ expect(File.exist?(filepath)).to be_truthy
42
42
 
43
43
  FileUtils.rm_rf(fixtures_project.output_directory)
44
44
  end
@@ -38,7 +38,7 @@ describe Slather::CoverageService::SonarqubeXmlOutput do
38
38
  fixtures_project.post
39
39
 
40
40
  filepath = "#{fixtures_project.output_directory}/sonarqube-generic-coverage.xml"
41
- expect(File.exists?(filepath)).to be_truthy
41
+ expect(File.exist?(filepath)).to be_truthy
42
42
 
43
43
  FileUtils.rm_rf(fixtures_project.output_directory)
44
44
  end
@@ -157,6 +157,22 @@ describe Slather::ProfdataCoverageFile do
157
157
  end
158
158
  end
159
159
 
160
+ describe "#branch_coverage_data" do
161
+ it "should have branch data for line 19" do
162
+ # these segments correspond to the only statement on line 19
163
+ profdata_coverage_file.segments = [[19, 9, 0, true, false], [19, 20, 1, true, false]]
164
+ expect(profdata_coverage_file.branch_coverage_data[19]).to eq([0,1])
165
+ end
166
+ it "should have missing region data for line 19" do
167
+ profdata_coverage_file.segments = [[19, 9, 0, true, false], [19, 20, 1, true, false]]
168
+ expect(profdata_coverage_file.branch_region_data[19]).to eq([[8,11]])
169
+ end
170
+ it "should have two missing region data for line 19" do
171
+ profdata_coverage_file.segments = [[19, 9, 0, true, false], [19, 20, 1, true, false], [19, 30, 0, true, false], [19, 40, 1, true, true]]
172
+ expect(profdata_coverage_file.branch_region_data[19]).to eq([[8,11], [29,10]])
173
+ end
174
+ end
175
+
160
176
  describe "#ignored" do
161
177
 
162
178
  before(:each) {
@@ -243,8 +243,9 @@ describe Slather::Project do
243
243
  allow(fixtures_project).to receive(:scheme).and_return("fixtures")
244
244
  fixtures_project.send(:configure_binary_file)
245
245
  binary_file_location = fixtures_project.send(:binary_file)
246
- expect(binary_file_location.count).to eq(1)
247
- expect(binary_file_location.first).to end_with("Debug/fixturesTests.xctest/Contents/MacOS/fixturesTests")
246
+ expect(binary_file_location.count).to eq(2)
247
+ expect(binary_file_location.first).to end_with("Debug/FixtureFramework.framework/Versions/A/FixtureFramework")
248
+ expect(binary_file_location.last).to end_with("Debug/fixturesTests.xctest/Contents/MacOS/fixturesTests")
248
249
  end
249
250
 
250
251
  it "should find the product path provided a workspace and scheme" do
@@ -252,8 +253,9 @@ describe Slather::Project do
252
253
  allow(fixtures_project).to receive(:scheme).and_return("fixtures")
253
254
  fixtures_project.send(:configure_binary_file)
254
255
  binary_file_location = fixtures_project.send(:binary_file)
255
- expect(binary_file_location.count).to eq(1)
256
- expect(binary_file_location.first).to end_with("Debug/fixturesTests.xctest/Contents/MacOS/fixturesTests")
256
+ expect(binary_file_location.count).to eq(2)
257
+ expect(binary_file_location.first).to end_with("Debug/FixtureFramework.framework/Versions/A/FixtureFramework")
258
+ expect(binary_file_location.last).to end_with("Debug/fixturesTests.xctest/Contents/MacOS/fixturesTests")
257
259
  end
258
260
 
259
261
  it "should find the product path for a scheme with no buildable products" do
@@ -664,10 +666,12 @@ describe Slather::Project do
664
666
  {
665
667
  "files":[
666
668
  {
667
- "filename":"spec/fixtures/fixtures/fixtures.m"
669
+ "filename":"spec/fixtures/fixtures/fixtures.m",
670
+ "segments": []
668
671
  },
669
672
  {
670
- "filename":"spec/fixtures/fixturesTwo/fixturesTwo.m"
673
+ "filename":"spec/fixtures/fixturesTwo/fixturesTwo.m",
674
+ "segments": []
671
675
  }
672
676
  ]
673
677
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slather
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Larsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-04 00:00:00.000000000 Z
11
+ date: 2023-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -156,28 +156,28 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '1.7'
159
+ version: '1.21'
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '1.7'
166
+ version: '1.21'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: nokogiri
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - "~>"
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
- version: '1.8'
173
+ version: 1.13.9
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - "~>"
178
+ - - ">="
179
179
  - !ruby/object:Gem::Version
180
- version: '1.8'
180
+ version: 1.13.9
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: CFPropertyList
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -255,6 +255,12 @@ files:
255
255
  - lib/slather/project.rb
256
256
  - lib/slather/version.rb
257
257
  - slather.gemspec
258
+ - spec/fixtures/FixtureFramework/FixtureFramework.h
259
+ - spec/fixtures/FixtureFramework/FlashExperiment.swift
260
+ - spec/fixtures/FixtureFramework/Info.plist
261
+ - spec/fixtures/FixtureFrameworkTests/FixtureFrameworkTests.swift
262
+ - spec/fixtures/FixtureFrameworkTests/FlashExperimentTests.swift
263
+ - spec/fixtures/FixtureFrameworkTests/Info.plist
258
264
  - spec/fixtures/cobertura.xml
259
265
  - spec/fixtures/fixtures.xcodeproj/project.pbxproj
260
266
  - spec/fixtures/fixtures.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -264,6 +270,7 @@ files:
264
270
  - spec/fixtures/fixtures.xcodeproj/xcshareddata/xcschemes/fixturesTestsSecond.xcscheme
265
271
  - spec/fixtures/fixtures.xcodeproj/xcshareddata/xcschemes/fixturesTwo.xcscheme
266
272
  - spec/fixtures/fixtures.xcworkspace/contents.xcworkspacedata
273
+ - spec/fixtures/fixtures.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
267
274
  - spec/fixtures/fixtures.xcworkspace/xcshareddata/xcschemes/fixturesTestsWorkspace.xcscheme
268
275
  - spec/fixtures/fixtures/Fixtures.swift
269
276
  - spec/fixtures/fixtures/Supporting Files/fixtures-Prefix.pch
@@ -334,11 +341,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
334
341
  - !ruby/object:Gem::Version
335
342
  version: '0'
336
343
  requirements: []
337
- rubygems_version: 3.1.3
344
+ rubygems_version: 3.2.22
338
345
  signing_key:
339
346
  specification_version: 4
340
347
  summary: Test coverage reports for Xcode projects
341
348
  test_files:
349
+ - spec/fixtures/FixtureFramework/FixtureFramework.h
350
+ - spec/fixtures/FixtureFramework/FlashExperiment.swift
351
+ - spec/fixtures/FixtureFramework/Info.plist
352
+ - spec/fixtures/FixtureFrameworkTests/FixtureFrameworkTests.swift
353
+ - spec/fixtures/FixtureFrameworkTests/FlashExperimentTests.swift
354
+ - spec/fixtures/FixtureFrameworkTests/Info.plist
342
355
  - spec/fixtures/cobertura.xml
343
356
  - spec/fixtures/fixtures.xcodeproj/project.pbxproj
344
357
  - spec/fixtures/fixtures.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -348,6 +361,7 @@ test_files:
348
361
  - spec/fixtures/fixtures.xcodeproj/xcshareddata/xcschemes/fixturesTestsSecond.xcscheme
349
362
  - spec/fixtures/fixtures.xcodeproj/xcshareddata/xcschemes/fixturesTwo.xcscheme
350
363
  - spec/fixtures/fixtures.xcworkspace/contents.xcworkspacedata
364
+ - spec/fixtures/fixtures.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
351
365
  - spec/fixtures/fixtures.xcworkspace/xcshareddata/xcschemes/fixturesTestsWorkspace.xcscheme
352
366
  - spec/fixtures/fixtures/Fixtures.swift
353
367
  - spec/fixtures/fixtures/Supporting Files/fixtures-Prefix.pch