aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.h
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-03 14:26:06 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-03 14:26:06 +0000
commitb0dd358c2feb240a18fbd711166697b336023018 (patch)
treee59051b5cb25f14ca7b6e45368118e083e762c98 /iseq.h
parentbaf11a634ba2d065e71431b777f4068d25da4d0c (diff)
downloadruby-b0dd358c2feb240a18fbd711166697b336023018.tar.gz
Refactor the internal data format for coverage measurement
To prepare new measuring targets: branch and method coverages. So far, iseq->coverage was an array of counts executed for line coverage. Now, it is a three-element array for each measuring target, whose first element is an array for line coverage. The second element is planned for branch coverage, and the third will be for method coverage. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.h')
-rw-r--r--iseq.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/iseq.h b/iseq.h
index b47b16aded..752fa838d8 100644
--- a/iseq.h
+++ b/iseq.h
@@ -47,6 +47,9 @@ iseq_mark_ary_create(int flip_cnt)
#define ISEQ_COVERAGE(iseq) RARRAY_AREF(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_COVERAGE)
#define ISEQ_COVERAGE_SET(iseq, cov) RARRAY_ASET(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_COVERAGE, cov)
+#define ISEQ_LINE_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_LINES)
+#define ISEQ_BRANCH_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_BRANCHES)
+#define ISEQ_METHOD_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_METHODS)
#define ISEQ_FLIP_CNT(iseq) FIX2INT(RARRAY_AREF(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_FLIP_CNT))