-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slather not working for projects with single source file #376
Comments
I manage to solve the issue, which apparently is connected to the comment in def source_file_pathname
@source_file_pathname ||= begin
if path_on_first_line?
path = self.source.split("\n")[0].sub ":", ""
path &&= Pathname(path)
else
# llvm-cov was run with just one matching source file
# It doesn't print the source path in this case, so we have to find it ourselves
# This is slow because we read every source file and compare it, but this should only happen if there aren't many source files
digest = Digest::MD5.digest(self.raw_source)
path = nil
project.find_source_files.each do |file|
file_digest = Digest::MD5.digest(File.read(file).strip)
if digest == file_digest
path = file
end
end
path
end
end
end My project contained only one Swift file. After adding another one, everything is working like expected, the problem disappeared. I think the issue is still valid for projects with one source file. The |
Fixing SlatherOrg#376 issue.
Fixing SlatherOrg#376 issue.
Should be fixed by #377 |
I have a problem with Slather in one of my iOS app projects. It fails with error when generating report:
I tried to investigate the issue myself, but I am not familiar with Ruby enough to solve it :-(
However, I found that this function from
/lib/slather/profdata_coverage_file.rb
:returns
1| |import UIKit
which looks like first line of some Swift source code file, instead of path to that file.I would be really thankful for any hints of steps I can take to solve this issue.
Here is my setup:
Xcode 9.3 / Swift 4.1
Ruby 2.4.1 (from RVM)
Slather 2.4.5
Fastlane 2.88.0 (I am running Slather from it)
Xcode is generating code coverage correctly. I am using correctly configured build scheme. I didn't notice any other issues with Fastlane (building, deploying etc) - everything else works like a charm.
The text was updated successfully, but these errors were encountered: