slather 2.4.9 → 2.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -2
- data/CHANGELOG.md +51 -0
- data/README.md +21 -1
- data/assets/slather.css +2 -1
- data/lib/slather/command/coverage_command.rb +4 -1
- data/lib/slather/coverage_file.rb +14 -9
- data/lib/slather/coverage_service/coveralls.rb +57 -0
- data/lib/slather/coverage_service/html_output.rb +51 -2
- data/lib/slather/profdata_coverage_file.rb +42 -2
- data/lib/slather/project.rb +35 -3
- data/lib/slather/version.rb +1 -1
- data/slather.gemspec +4 -4
- data/spec/fixtures/FixtureFramework/FixtureFramework.h +19 -0
- data/spec/fixtures/FixtureFramework/FlashExperiment.swift +7 -0
- data/spec/fixtures/FixtureFramework/Info.plist +24 -0
- data/spec/fixtures/FixtureFrameworkTests/FixtureFrameworkTests.swift +34 -0
- data/spec/fixtures/FixtureFrameworkTests/FlashExperimentTests.swift +9 -0
- data/spec/fixtures/FixtureFrameworkTests/Info.plist +22 -0
- data/spec/fixtures/fixtures.xcodeproj/project.pbxproj +222 -0
- data/spec/fixtures/fixtures.xcodeproj/xcshareddata/xcschemes/fixtures.xcscheme +21 -5
- data/spec/fixtures/fixtures.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- data/spec/slather/coverage_service/coveralls_spec.rb +20 -0
- data/spec/slather/coverage_service/html_output_spec.rb +2 -2
- data/spec/slather/profdata_coverage_spec.rb +16 -0
- data/spec/slather/project_spec.rb +12 -8
- metadata +28 -20
@@ -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">
|
@@ -151,6 +151,26 @@ describe Slather::CoverageService::Coveralls do
|
|
151
151
|
ENV['GIT_BRANCH'] = git_branch
|
152
152
|
end
|
153
153
|
end
|
154
|
+
|
155
|
+
context "coverage_service is :github" do
|
156
|
+
before(:each) { fixtures_project.ci_service = :github }
|
157
|
+
|
158
|
+
it "should return valid json for coveralls coverage data" do
|
159
|
+
allow(fixtures_project).to receive(:github_job_id).and_return("9182")
|
160
|
+
allow(fixtures_project).to receive(:coverage_access_token).and_return("abc123")
|
161
|
+
allow(fixtures_project).to receive(:github_pull_request).and_return("1")
|
162
|
+
allow(fixtures_project).to receive(:github_build_url).and_return("https://github.com/Bruce/Wayne/actions/runs/1")
|
163
|
+
allow(fixtures_project).to receive(:github_git_info).and_return({ :head => { :id => "ababa123", :author_name => "bwayne", :message => "hello" }, :branch => "master" })
|
164
|
+
expect(fixtures_project.send(:coveralls_coverage_data)).to be_json_eql("{\"service_job_id\":\"9182\",\"service_name\":\"github\",\"repo_name\":\"\",\"repo_token\":\"abc123\",\"service_pull_request\":\"1\",\"service_build_url\":\"https://github.com/Bruce/Wayne/actions/runs/1\",\"git\":{\"head\":{\"id\":\"ababa123\",\"author_name\":\"bwayne\",\"message\":\"hello\"},\"branch\":\"master\"}}").excluding("source_files")
|
165
|
+
expect(fixtures_project.send(:coveralls_coverage_data)).to be_json_eql(fixtures_project.coverage_files.map(&:as_json).to_json).at_path("source_files")
|
166
|
+
end
|
167
|
+
|
168
|
+
it "should raise an error if there is no GITHUB_RUN_ID" do
|
169
|
+
allow(fixtures_project).to receive(:github_job_id).and_return(nil)
|
170
|
+
expect { fixtures_project.send(:coveralls_coverage_data) }.to raise_error(StandardError)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
154
174
|
end
|
155
175
|
|
156
176
|
describe '#coveralls_coverage_data' do
|
@@ -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(:
|
189
|
-
|
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| |//
|
@@ -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(
|
247
|
-
expect(binary_file_location.first).to end_with("Debug/
|
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(
|
256
|
-
expect(binary_file_location.first).to end_with("Debug/
|
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
|
@@ -653,8 +655,8 @@ describe Slather::Project do
|
|
653
655
|
it "should find relevant source files" do
|
654
656
|
source_files = fixtures_project.find_source_files
|
655
657
|
expect(source_files.count).to eq(2)
|
656
|
-
expect(source_files.first.to_s).to include("
|
657
|
-
expect(source_files.last.to_s).to include("
|
658
|
+
expect(source_files.first.to_s).to include("fixturesTwo.m")
|
659
|
+
expect(source_files.last.to_s).to include("fixtures.m")
|
658
660
|
end
|
659
661
|
|
660
662
|
it "should print out the coverage for each file, and then total coverage" 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.
|
4
|
+
version: 2.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Larsen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: coveralls
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 1.10.beta.1
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 1.10.beta.1
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: json_spec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: '1.
|
173
|
+
version: '1.11'
|
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.
|
180
|
+
version: '1.11'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: CFPropertyList
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -202,23 +202,17 @@ dependencies:
|
|
202
202
|
name: activesupport
|
203
203
|
requirement: !ruby/object:Gem::Requirement
|
204
204
|
requirements:
|
205
|
-
- - "<"
|
206
|
-
- !ruby/object:Gem::Version
|
207
|
-
version: '5'
|
208
205
|
- - ">="
|
209
206
|
- !ruby/object:Gem::Version
|
210
|
-
version:
|
207
|
+
version: '0'
|
211
208
|
type: :runtime
|
212
209
|
prerelease: false
|
213
210
|
version_requirements: !ruby/object:Gem::Requirement
|
214
211
|
requirements:
|
215
|
-
- - "<"
|
216
|
-
- !ruby/object:Gem::Version
|
217
|
-
version: '5'
|
218
212
|
- - ">="
|
219
213
|
- !ruby/object:Gem::Version
|
220
|
-
version:
|
221
|
-
description:
|
214
|
+
version: '0'
|
215
|
+
description:
|
222
216
|
email:
|
223
217
|
- mark@venmo.com
|
224
218
|
executables:
|
@@ -261,6 +255,12 @@ files:
|
|
261
255
|
- lib/slather/project.rb
|
262
256
|
- lib/slather/version.rb
|
263
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
|
264
264
|
- spec/fixtures/cobertura.xml
|
265
265
|
- spec/fixtures/fixtures.xcodeproj/project.pbxproj
|
266
266
|
- spec/fixtures/fixtures.xcodeproj/project.xcworkspace/contents.xcworkspacedata
|
@@ -270,6 +270,7 @@ files:
|
|
270
270
|
- spec/fixtures/fixtures.xcodeproj/xcshareddata/xcschemes/fixturesTestsSecond.xcscheme
|
271
271
|
- spec/fixtures/fixtures.xcodeproj/xcshareddata/xcschemes/fixturesTwo.xcscheme
|
272
272
|
- spec/fixtures/fixtures.xcworkspace/contents.xcworkspacedata
|
273
|
+
- spec/fixtures/fixtures.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
|
273
274
|
- spec/fixtures/fixtures.xcworkspace/xcshareddata/xcschemes/fixturesTestsWorkspace.xcscheme
|
274
275
|
- spec/fixtures/fixtures/Fixtures.swift
|
275
276
|
- spec/fixtures/fixtures/Supporting Files/fixtures-Prefix.pch
|
@@ -325,7 +326,7 @@ homepage: https://github.com/SlatherOrg/slather
|
|
325
326
|
licenses:
|
326
327
|
- MIT
|
327
328
|
metadata: {}
|
328
|
-
post_install_message:
|
329
|
+
post_install_message:
|
329
330
|
rdoc_options: []
|
330
331
|
require_paths:
|
331
332
|
- lib
|
@@ -341,10 +342,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
341
342
|
version: '0'
|
342
343
|
requirements: []
|
343
344
|
rubygems_version: 3.1.3
|
344
|
-
signing_key:
|
345
|
+
signing_key:
|
345
346
|
specification_version: 4
|
346
347
|
summary: Test coverage reports for Xcode projects
|
347
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
|
348
355
|
- spec/fixtures/cobertura.xml
|
349
356
|
- spec/fixtures/fixtures.xcodeproj/project.pbxproj
|
350
357
|
- spec/fixtures/fixtures.xcodeproj/project.xcworkspace/contents.xcworkspacedata
|
@@ -354,6 +361,7 @@ test_files:
|
|
354
361
|
- spec/fixtures/fixtures.xcodeproj/xcshareddata/xcschemes/fixturesTestsSecond.xcscheme
|
355
362
|
- spec/fixtures/fixtures.xcodeproj/xcshareddata/xcschemes/fixturesTwo.xcscheme
|
356
363
|
- spec/fixtures/fixtures.xcworkspace/contents.xcworkspacedata
|
364
|
+
- spec/fixtures/fixtures.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
|
357
365
|
- spec/fixtures/fixtures.xcworkspace/xcshareddata/xcschemes/fixturesTestsWorkspace.xcscheme
|
358
366
|
- spec/fixtures/fixtures/Fixtures.swift
|
359
367
|
- spec/fixtures/fixtures/Supporting Files/fixtures-Prefix.pch
|