From 47ea999b4689fc591478a05da1670d2008a4a705 Mon Sep 17 00:00:00 2001 From: mame Date: Sat, 20 Oct 2018 05:33:04 +0000 Subject: ext/coverage/: add the oneshot mode This patch introduces "oneshot_lines" mode for `Coverage.start`, which checks "whether each line was executed at least once or not", instead of "how many times each line was executed". A hook for each line is fired at most once, and after it is fired, the hook flag was removed; it runs with zero overhead. See [Feature #15022] in detail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- internal.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'internal.h') diff --git a/internal.h b/internal.h index f6fcd399b7..ce7d98a878 100644 --- a/internal.h +++ b/internal.h @@ -1852,12 +1852,14 @@ struct timeval rb_time_timeval(VALUE); #define COVERAGE_TARGET_LINES 1 #define COVERAGE_TARGET_BRANCHES 2 #define COVERAGE_TARGET_METHODS 4 +#define COVERAGE_TARGET_ONESHOT_LINES 8 VALUE rb_obj_is_mutex(VALUE obj); VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg); void rb_thread_execute_interrupts(VALUE th); void rb_clear_trace_func(void); VALUE rb_get_coverages(void); +int rb_get_coverage_mode(void); VALUE rb_default_coverage(int); VALUE rb_thread_shield_new(void); VALUE rb_thread_shield_wait(VALUE self); -- cgit v1.2.3