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

Support for specifying llvm-cov source files #201

Merged
merged 16 commits into from
May 4, 2016

Conversation

matej
Copy link
Contributor

@matej matej commented May 4, 2016

This PR addresses some issues we had to overcome to make Slather work (well) with our test setup at PSPDFKit.

See the commit message for details but the essential part is:

Added a way to specify source file filters.

  • Uses ruby’s Dir.glob for maximum flexibility and easy lookup.
  • Files are passed to llvm-cov to speed up processing.
  • If ignore patterns are also given, they are applied before the files are passed to llvm-cov so ignored files are not processed at all.
  • If multiple binaries are processed, the already processed files get excluded during subsequent runs, speeding up processing, if there is a lot of overlap between the binaries.

For our relatively complex test setup where we have multiple test projects covering multiple libraries with quite a bit of overlap between coverage, this resulted in the processing time going down from about 2 minutes to around 30 seconds.

The new option does not apply to gcov files. I haven't looked closely, but from glancing ove the implementation it seems like it would not make any sense there.

matej added 14 commits April 27, 2016 18:51
The value should be preserved if it was passed in using command line arguments.
We were seeing the following showing up as a new file:

```
warning The file '/Users/ci/.ccache/tmp/CALayer-KI.stdout.macmini08.92540.QAQaxt.mi' isn't covered.
```
- Uses ruby’s Dir.glob for maximum flexibility and easy lookup.
- Files are passed to llvm-cov to speed up processing. 
- If ignore patterns are also given, they are applied before the files are passed to llvm-cov so ignored files are not processed at all. 
- If multiple binaries are processed, the already processed files get excluded during subsequent runs, speeding up processing, if there is a lot of overlap between the binaries.
If we provide a single line to llvm-cov, the usual first line pathname output is skipped, and we instead immediately get the source code.
Can also handle made up paths in tests.
@matej
Copy link
Contributor Author

matej commented May 4, 2016

Ah, looks like I addressed the same issue as 988c0b1#diff-db3aebc6a6233da7b7bca5b646c4fa09R325. Will resolve the conflict.

Conflicts:
	lib/slather/project.rb
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 95.014% when pulling 5f5f168 on PSPDFKit-labs:matej/soruce-files into 988c0b1 on SlatherOrg:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 95.014% when pulling efbc45b on PSPDFKit-labs:matej/soruce-files into 988c0b1 on SlatherOrg:master.

@neonichu
Copy link
Member

neonichu commented May 4, 2016

This is great 👍 — thanks a lot for the contribution 👏

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 this pull request may close these issues.

3 participants