Comments (6)
That is exactly what would be required :)
Please go ahead if you think you can build something that returns a Coverage.result compatible with 1.9.x, that'd be awesome!
from simplecov.
Okay, preliminary work on this is here:
https://github.com/rubyworks/tracepoint/blob/master/lib/tracepoint/coverage.rb
It's not 100% exact to 1.9's Coverage library but it looks like it will be close enough. Here is an example of coverage for foo.rb
in tracepiont's try/
directory:
tracepoint: [nil, nil, 2, 1, nil, nil, 2, nil, nil, nil, 1]
ruby 1.9 : [nil, nil, 1, 1, nil, nil, 1, 0, nil, nil, 1, nil]
The difference being that tracepoint counted one line twice, and does not include trailing blank lines.
The bigger issue though, is that I have not figured out a way to exclude files that aren't relevant from the coverage results b/c $LOADED_FEATURES in Ruby 1.8 doesn't use absolute paths. Any ideas?
from simplecov.
Pretty awesome! Did you try to do File.expand_path
on the $LOADED_FEATURES
array?
from simplecov.
Unfortunately File.expand_path won't work b/c that would make the path relative to the current working directory rather than the lib directories from which they are actually found.
I could match against the end of the path, that would probably work fine most of the time, but on occasion a false positive could creep in.
from simplecov.
Closing since basic compatibilty seems to be hard to achieve, nothing has happend on this for a while and also Ruby 1.8 is on the way out (official support even stops soon) and has a decent coverage lib in RCov, I don't think this is a subject worthwile of further keeping around. Please update if there are objections to this, and thanks for trying to make this work!
from simplecov.
Yep, I agree. 1.8 is finally about done.
Ironically it was thanks to this endeavor that I discovered Ruby 1.9's #set_trace_func is broken. And from conversation on core it sounds like no one plans to fix it. Rather the vibe I got was that #set_trace_func itself is on the way out. That being the case TracePoint has no means for working beyond 1.8 :-(
So it's a good thing I tried any way. C'est la vie.
from simplecov.
Related Issues (20)
- allow skipping (unreachable) branch coverage only HOT 10
- option to disable line warnings with `enable_coverage_for_eval` and rails views HOT 3
- Use of ractors makes coverage non-deterministic HOT 3
- Branch coverage for the files which don't have _spec files
- "Coverage report generated" is being written to the stdout stream
- Default configurations around coverage criteria and minimum coverage
- Minor documentation fix
- [Feature Request] Don't require all branches to be covered twice in ensure-blocks HOT 3
- Support for other Parallel Testing gems
- SimpleCov does not fail for low coverage for parallel_tests when using 1 process
- SimpleCov only reports the last controller test and sets to 0.0% all previous results HOT 1
- False positives for `begin` lines, a constant definition, and some heredoc content
- مشکل <3
- Rails 7.1 update => test coverage drop HOT 6
- Coverage changes after each run HOT 1
- 0.22.0 release is missing on GitHub
- Coverage dropped in Rails 7.1 (fixed) HOT 1
- Bad usability on bigger projects (>1000s files)
- README says SimpleCov.start should be called after SimpleCov.at_fork, is it true? HOT 1
- Combining branch data on parallel runs?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simplecov.