14 static int current_mode;
26 int mode, experimental_mode_enabled = 1;
29 const char *e =
getenv(
"COVERAGE_EXPERIMENTAL_MODE");
30 if (!e || !*e) experimental_mode_enabled = 0;
33 if (!experimental_mode_enabled && argc != 0)
59 if (!
RTEST(coverages)) {
66 else if (current_mode != mode) {
73 branch_coverage(
VALUE branches)
87 for (j = 2; j <
RARRAY_LEN(branches); j += 3) {
99 method_coverage(
VALUE methods)
121 if (current_mode == 0) {
167 rb_coverage_peek_result(
VALUE klass)
171 if (!
RTEST(coverages)) {
187 rb_coverage_result(
VALUE klass)
189 VALUE ncoverages = rb_coverage_peek_result(klass);
202 rb_coverage_running(
VALUE klass)
VALUE rb_ary_freeze(VALUE ary)
void rb_raise(VALUE exc, const char *fmt,...)
#define COVERAGE_TARGET_LINES
VALUE rb_hash_lookup(VALUE hash, VALUE key)
void rb_set_coverages(VALUE coverages, int mode)
#define COVERAGE_INDEX_BRANCHES
RUBY_SYMBOL_EXPORT_BEGIN typedef unsigned long st_data_t
VALUE rb_hash_aset(VALUE hash, VALUE key, VALUE val)
VALUE rb_get_coverages(void)
void rb_define_module_function(VALUE module, const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a module function for module.
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
#define COVERAGE_INDEX_LINES
VALUE rb_obj_hide(VALUE obj)
Make the object invisible from Ruby code.
VALUE rb_hash_freeze(VALUE hash)
void rb_reset_coverages(void)
#define RARRAY_AREF(a, i)
#define COVERAGE_TARGET_METHODS
void rb_error_arity(int argc, int min, int max)
VALUE rb_convert_type(VALUE, int, const char *, const char *)
Converts an object into another type.
VALUE rb_ary_dup(VALUE ary)
VALUE() rb_ary_new_from_args(long n,...)
VALUE rb_define_module(const char *name)
#define COVERAGE_TARGET_BRANCHES
#define COVERAGE_INDEX_METHODS