slather: slather code coverage error : find_binary_files

I am getting following error while generate a code coverage report. Could you please help me in this?

— Step: cd … && mkdir -p ‘build/reports/unit_test’ && slather coverage --cobertura-xml --output-directory ‘build/reports/unit_test’ --input-format profdata --build-directory DerivedData --source-directory . --scheme ‘myAppTests’ --workspace ‘myApp.xcworkspace’ --binary-basename ‘myApp’ *.xcodeproj —


$ cd … && mkdir -p ‘build/reports/unit_test’ && slather coverage --cobertura-xml --output-directory ‘build/reports/unit_test’ --input-format profdata --build-directory DerivedData --source-directory . --scheme ‘myAppTests’ --workspace ‘myApp.xcworkspace’ --binary-basename ‘myApp’ *.xcodeproj ▸ /Users/admin/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/slather-2.2.1/lib/slather/project.rb:459:in find_binary_files': No product binary found in DerivedData/Build/Intermediates/CodeCoverage. (StandardError) ▸ from /Users/admin/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/slather-2.2.1/lib/slather/project.rb:344:inconfigure_binary_file’ ▸ from /Users/admin/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/slather-2.2.1/lib/slather/project.rb:240:in configure' ▸ from /Users/admin/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/slather-2.2.1/lib/slather/command/coverage_command.rb:50:inexecute’ ▸ from /Users/admin/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in run' ▸ from /Users/admin/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/clamp-0.6.5/lib/clamp/subcommand/execution.rb:11:inexecute’ ▸ from /Users/admin/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in run' ▸ from /Users/admin/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/clamp-0.6.5/lib/clamp/command.rb:132:inrun’ ▸ from /Users/admin/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/slather-2.2.1/bin/slather:17:in <top (required)>' ▸ from /Users/admin/.rbenv/versions/2.2.4/bin/slather:23:inload’ ▸ from /Users/admin/.rbenv/versions/2.2.4/bin/slather:23:in `<main>’ ▸ Slathering… ▸ No product binary found in DerivedData/Build/Intermediates/CodeCoverage. ▸ 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)

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Comments: 21 (6 by maintainers)

Most upvoted comments

Now I see why it doesn’t work with --binary-basename. My project is a Pod project and the framework that I want to test is therefore built as separate product. The framework resides in a subfolder myFramework-iOS. Slather only looks for the binary inside Debug-iphonesimulator, therefore I have to specify the basename as myFramework-iOS/myFramework.frameworkin order for it to work. @ksuther @neonichu How about we let slather look inside subfolders as well? Something like this would work:

directories = Dir["#{profdata_coverage_dir}/Products/#{configuration}*/#{search_for}*"]
directories += Dir["#{profdata_coverage_dir}/Products/#{configuration}*/#{search_for}*/#{search_for}.*"]