Issue #12812 has been updated by mame (Yusuke Endoh).

Status changed from Assigned to Feedback

Sorry for leaving this ticket untouched.

I cannot remember the detailed story of this ticket, but since 2.6, coverage library has supported `Coverage.result(stop: false, clear: false)`.  Is it enough?  I still think `Coverage.result=` is too powerful.

----------------------------------------
Bug #12812: Added Coverage#result=
https://bugs.ruby-lang.org/issues/12812#change-76443

* Author: zenspider (Ryan Davis)
* Status: Feedback
* Priority: Normal
* Assignee: mame (Yusuke Endoh)
* Target version: 
* ruby -v: 
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Originally submitted here: https://github.com/ruby/ruby/pull/1456

This exposes Coverage.result in a slightly more writeable way and allows coverage analysis to reset to a baseline in a safe way.

Note, I wasn't able to figure out how to invalidate the cached pointers in the VM bytecode, so this does `rb_ary_replace` across all the arrays instead. I'd love to see this improved so it were cleaner.

This is ongoing work to improve the current state of code coverage analysis. I'll be giving a talk on this at rubyconf 2016.

I should also add, this applies cleanly to (at least) 2.3 as well.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>