0

first of all thank you in advance for helping me figure this out. I recently try using slather to produce a code coverage report for my xcode project, but when i execute slather it fail with error below

Are you sure your project is generating coverage? Make sure you enable code coverage in the Test section of your Xcode scheme. Did you specify your Xcode scheme? (--scheme or 'scheme' in .slather.yml) If you're using a workspace, did you specify it? (--workspace or 'workspace' in .slather.yml) If you use a different Xcode configuration, did you specify it? (--configuration or 'configuration' in .slather.yml)

even though i already specify all configuration mention above in .slather.yml file. But i'm still getting the same error. Below are my .slather.yml code

output_directory: slather-report
scheme: *Project scheme* // This scheme has enabled code coverage in test section 
workspace: *Project*.xcworkspace 
xcodeproj: *Project*.xcodeproj 
configuration: Staging 
arch: x86_64 
html: true 
ignore: 
- Pods/* 

so i go through the slather project.rb file and find out that slather try to find a file called Coverage.profdata. But upon executing Xcode unitTest, Xocde never generate any file with name Coverage.profdata, Even though i already enable code coverage on that particular scheme.

So, am i missing something on generating Coverage.profdata, if yes please let me know? Thank you again in advance

auyotoc
  • 1
  • 1
  • 2

1 Answers1

1

The Coverage.profdata file is usually present in the Build/Intermediate/{scheme}/ProfileData directory. Make sure that the file is present there.

Also, make sure you are using the Product->Test option to generate the Coverage.profdata file as simply running the target in Release/Debug mode will not generate the code coverage data.

Bharath
  • 171
  • 1
  • 15