Traditionally, method coverage measurement was implemented by inserting
`trace2` instruction to the head of method iseq. So, it just measured
methods defined by `def` keyword.
This commit drastically changes the measuring mechanism of method
coverage; at `RUBY_EVENT_CALL`, it keeps a hash from rb_method_entry_t*
to runs (i.e., it counts the runs per method entry), and at
`Coverage.result`, it creates the result hash by enumerating all
`rb_method_entry_t*` objects (by `ObjectSpace.each_object`).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
To measure coverage of C code:
`./configure --enable-gcov && make && make exam && make lcov`
To measure coverage of Ruby code:
`./configure && make && make exam COVERAGE=true && make lcov`
To measure coverage of both languages at a time:
`./configure --enable-gcov && make && make exam COVERAGE=true && make lcov`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Now `make test-all COVERAGE=true` measures the test coverage by using
`coverage.so` directly, and visualize the result by simplecov-html.
There has been some problems in coverage measurement with SimpleCov.
(They are not SimpleCov's fault, though.)
(1) It is difficult to extract the measured data as a machine-readable
format, such as Marshal. I want to visualize the coverage data with
other coverage tools, such as LCOV and Cobertura.
(I know we can use SimpleCov's formatter mechanism, but I don't want
to depend upon SimpleCov so much.)
(2) SimpleCov seems to miss some coverage data. For example,
`lib/cgi.rb` and `lib/ostruct.rb` are dropped. I don't know why.
(3) I have a plan to enhance `coverage.so` with branch coverage.
It would be difficult to continue to only use SimpleCov as is.
This is the most important reason.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e