From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.4 required=3.0 tests=AWL,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id C9E341F453 for ; Mon, 21 Jan 2019 08:37:42 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 5BE9A121EB0; Mon, 21 Jan 2019 17:37:40 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 52139121EB0 for ; Mon, 21 Jan 2019 17:37:37 +0900 (JST) Received: by filter0137p3mdw1.sendgrid.net with SMTP id filter0137p3mdw1-32043-5C4584CF-1E 2019-01-21 08:37:35.543362993 +0000 UTC m=+541795.584733483 Received: from herokuapp.com (ec2-54-205-253-189.compute-1.amazonaws.com [54.205.253.189]) by ismtpd0042p1mdw1.sendgrid.net (SG) with ESMTP id hV3XnMuRTE-SvtDUPwqdtQ for ; Mon, 21 Jan 2019 08:37:35.409 +0000 (UTC) Date: Mon, 21 Jan 2019 08:37:36 +0000 (UTC) From: mame@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66654 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 12812 X-Redmine-Issue-Author: zenspider X-Redmine-Issue-Assignee: mame X-Redmine-Sender: mame X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS48oElTHD4yL17RpXKEwfQWx2GNr0+N/lugSc TPNr4Pb3w/lzgDnYlgEK6q73+vyTMeyn4y4JXjuhAmgdXnkwae5Wponkob2bUUyUOBwbv/vfXLWjxz tmMUotFLh8VCMPHMUcq5Bn+z+p63eTX4bsEs90HxD1L4c71nBpSyFX8Ctw== X-ML-Name: ruby-core X-Mail-Count: 91206 Subject: [ruby-core:91206] [Ruby trunk Bug#12812] Added Coverage#result= X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" 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/