Skip to content
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

Xcode 7.3 changes location of Coverage.profdata #125

Closed
raven opened this issue Jan 21, 2016 · 5 comments · Fixed by #169
Closed

Xcode 7.3 changes location of Coverage.profdata #125

raven opened this issue Jan 21, 2016 · 5 comments · Fixed by #169

Comments

@raven
Copy link

raven commented Jan 21, 2016

Xcode 7.2 would place Coverage.profdata within
#{build_directory}/**/CodeCoverage/#{self.scheme}/

However in 7.3, Coverage.profdata doesn't get nested within a directory matching the scheme name.
#{build_directory}/**/CodeCoverage/

@neonichu neonichu added this to the 2.0.0 milestone Feb 3, 2016
@neonichu
Copy link
Member

neonichu commented Feb 4, 2016

Can't actually repro slather not finding the profdata files with 7.3 beta 2. However, coverage information is also not computed correctly for me.

I'm descoping this from 2.0.0 since it needs more investigation and 7.3 is still in beta.

@manuyavuz
Copy link

Seems like in Xcode 7.3 (I'm using beta 4 now), Coverage.profdata file inside Build/Intermediates/CodeCoverage/ folder is being overwritten by the last run in the Xcode regardless of the scheme to be tested. In Xcode 7.2, all schemes were having different Coverage.profdata files inside their corresponding subdirectory Build/Intermediates/CodeCoverage/#{scheme_name}.

This causes both --scheme option and the default scenario (slather finding path using .app dropped product name).

@manuyavuz
Copy link

I could make it work again by changing the following line here:

dir = Dir[File.join("#{build_directory}","/**/#{first_product_name}")].first

to below line:

dir = Dir[File.join("#{build_directory}","/**/CodeCoverage")].first

But I'm not sure how this can be changed providing backward compatibility.

@neonichu
Copy link
Member

neonichu commented Mar 7, 2016

I think a reasonable way to deal with this could be checking the Xcode version explicitly, like

$ xcodebuild -version
Xcode 6.4

And if that is 7.3 or higher, use the new path. This wouldn't be 100% accurate, as the selected Xcode version isn't necessarily the one used to do the last run for a certain project, but since CI is the most common use case, it should be OK.

@mapedd
Copy link

mapedd commented Oct 5, 2016

TIL: there is an env var now that points to exact path of Coverage.profdata file:

CLANG_COVERAGE_PROFILE_FILE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants