Add spec for Coverage.supported? and start(eval: true). (#6499)

* Don't emit coverage for eval when eval coverage is disabled.
This commit is contained in:
Samuel Williams 2022-10-08 00:33:40 +13:00 committed by GitHub
parent 1e6cdc76e4
commit 24f3e397e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2022-10-07 20:34:13 +09:00
Merged-By: ioquatix <samuel@codeotaku.com>
2 changed files with 29 additions and 6 deletions

View file

@ -11,6 +11,7 @@
**********************************************************************/
#include "internal/thread.h"
struct local_var_list {
VALUE tbl;
};
@ -1672,7 +1673,9 @@ eval_make_iseq(VALUE src, VALUE fname, int line, const rb_binding_t *bind,
rb_iseq_t *iseq = NULL;
rb_ast_t *ast;
int isolated_depth = 0;
int coverage_enabled = Qtrue;
// Conditionally enable coverage depending on the current mode:
VALUE coverage_enabled = RBOOL(rb_get_coverage_mode() & COVERAGE_TARGET_EVAL);
{
int depth = 1;