aboutsummaryrefslogtreecommitdiffstats
path: root/test/coverage
Commit message (Collapse)AuthorAgeFilesLines
* Add test cases for branch coverageyui-knk2017-10-231-2/+8
| | | | | | | * test/coverage/test_coverage.rb (test_branch_coverage_for_while_statement): Add test cases for modifier while/until. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add test cases for branch coverageyui-knk2017-10-221-6/+9
| | | | | | | * test/coverage/test_coverage.rb (test_branch_coverage_for_if_statement): Add a test case for ternary operator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add test cases for branch coverageyui-knk2017-10-221-4/+9
| | | | | | | * test/coverage/test_coverage.rb (test_branch_coverage_for_if_statement): Add test cases for modifier if/unless. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add test cases for branch coverageyui-knk2017-10-221-2/+12
| | | | | | | * test/coverage/test_coverage.rb (test_branch_coverage_for_if_statement): Add test cases for if/unless without else clauses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/coverage/test_coverage.rb: Use `<<~` to ease to calculate column of ↵yui-knk2017-10-221-14/+14
| | | | | | target codes git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add column numbers to branch coverageyui-knk2017-10-221-10/+10
| | | | | | | | | | | | | | | * compile.c (DECL_BRANCH_BASE, ADD_TRACE_BRANCH_COVERAGE): Add column to arguments. * compile.c (compile_if, compile_case, compile_when, compile_loop, iseq_compile_each0): Pass column numbers to macros. * ext/coverage/coverage.c (branch_coverage): Add column numbers to a return value. * test/coverage/test_coverage.rb: Follow-up these changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/coverage/test_coverage.rb: Refactor coverage tests.mame2017-09-231-124/+116
| | | | | | | Add `assert_coverage` to invoke Ruby script under coverage measurement and to compare the result with an expected value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Enable to take branch coverages for safe method invocationsyui-knk2017-09-231-0/+21
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Introduce NODE_UNLESS for branch coveragemame2017-09-141-1/+7
| | | | | | | `unless` statement was a syntactic sugar for `if` statement, which made the result of branch coverage hard to understand. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add method coveragemame2017-09-141-0/+25
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix the lineno of case statement that has no expressionmame2017-09-141-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add branch coverage for case-when statementmame2017-09-141-0/+54
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add branch coverage for while and until statementsmame2017-09-141-0/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add branch coverage for if statementmame2017-09-141-0/+27
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: pop coverage tracenobu2017-09-101-0/+10
| | | | | | | * compile.c (iseq_compile_each0): pop trace for coverage only and clear its corresponding line. [ruby-core:82726] [Bug #13886] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_coverage.rb: suppress warningsnobu2017-09-031-2/+2
| | | | | | | | | | * test/coverage/test_coverage.rb (test_nonpositive_linenumber): suppress method redefinition warnings. * test/coverage/test_coverage.rb (test_eval): suppress literal in void context warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_coverage.rb: use real pathnobu2017-09-031-0/+1
| | | | | | | | | * test/coverage/test_coverage.rb (test_restarting_coverage): use real directory path for the case $TMPDIR contains symlinks. on macOS, it is defaulted to a path under /var which is a symlink to /private/var. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/coverage/test_coverage.rb: run the tests in separated processesmame2017-09-021-73/+73
| | | | | | | | | | | | | | | The tests had been disabled under coverage measurement (during `ENV['COVERAGE']`), since they call `Coverage.result` which stops coverage measurement. So, we couldn't measure both C-level and Ruby-level coverage of Ruby simultaneously. In short, `./configure --enable-gcov && make exam COVERAGE=true` misses some coverages. Now, the test runs in another process. They does not stop coverage measurement, so we can now enable the tests under coverage measurement. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/coverage/coverage.c: add Coverage.enabled?mame2017-09-011-0/+10
| | | | | | | | * ext/coverage/coverage.c (rb_coverage_running): add to quickly check if coverage is enabled. patched by Burke Libbey <burke AT libbey.me> in [ruby-core:81726]. [Feature #13667] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* suppress_warningnaruse2017-04-251-3/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix a consistency bug of ISEQ_COVERAGE [Bug #13305]mame2017-03-141-0/+30
| | | | | | | | | There is an invariant that ISEQ_COVERAGE(iseq) must be Qnil if and only if option->coverage_enabled is false. This invariant was broken by NODE_PRELUDE which updates option->coverage_enabled but not ISEQ_COVERAGE(iseq). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Coverage on non-positive linesnobu2016-06-261-0/+9
| | | | | | | | | * compile.c (ADD_TRACE): ignore trace instruction on non-positive line. * parse.y (coverage): get rid of ArgumentError when the starting line number is not positive. [ruby-core:76141] [Bug #12517] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_coverage.rb: suppress warningsnobu2016-04-111-5/+5
| | | | | | | | * test/coverage/test_coverage.rb (test_coverage_snapshot), (test_restarting_coverage): use unique names to suppress method redefinition warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/coverage/coverage.c: Fully reset coverage to not persist global state.eregon2016-04-061-7/+6
| | | | | | | | | | It was returning old file coverages as empty arrays to the user. [ruby-core:74596] [Bug #12220] * ext/coverage/coverage.c (rb_coverages): remove unused static state. * thread.c: Moved and renamed coverage_clear_result_i to reset_coverage_i. * test/coverage/test_coverage.rb: improve precision of tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/coverage/test_coverage.rb: ignored test when enabled to coverage.hsbt2016-01-041-1/+1
| | | | | | It lead to crash with `make test-all`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/coverage/test_coverage.rb: Added test-case for Coverage.restart.hsbt2015-11-261-0/+18
| | | | | | [Misc #11732][ruby-dev:49379] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/coverage/test_coverage.rb: Added test-case for Coverage.peek_resulthsbt2015-11-261-0/+5
| | | | | | without Coverage.start. [Misc #11726][ruby-core:71622] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/coverage/coverage.c: Add Coverage.peek_result. Allows you totenderlove2015-02-131-0/+26
| | | | | | | | | capture coverage information without stopping the coverage tool. [ruby-core:67940] [Feature #10816] * test/coverage/test_coverage.rb: test for change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* suppress warning introduced by r42439 [ruby-dev:47040]naruse2013-08-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/coverage/test_coverage.rb (TestCoverage#test_big_code): use `1'usa2013-08-081-1/+1
| | | | | | | | | | | instead of `p' to get rid of a side effect. Kernel#p without any argument seems to do nothing, but flushes stdout. and, if stdout is redirected to file, fsync() will be called on Windows. so, when running test-all on Windows with redirection, such as CI environment, this test took a lot of time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (update_coverage): skip coverage count up if the currentmame2011-08-231-2/+23
| | | | | | | | | line is out of the way. rb_sourceline() is unreliable when source code is big. [ruby-dev:44413] * test/coverage/test_coverage.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/coverage/coverage.c: resurrect r32071 + add GC guard fornagachika2011-07-041-0/+25
| | | | | | | | | rb_coverages. [ruby-core:37352] [Bug #4927] [ruby-core:36539] [Feature #4796] * test/coverage/test_coverage.rb resurrect r32071. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/coverage/coverage.c: revert r32071. The commit caused SEGV onmame2011-07-041-25/+0
| | | | | | | | | | some minor nonfree OS. I have no means of debugging the bug. My personal opinion is that such OS should be unsupported unless there is an active maintainer. [ruby-core:37352] * test/coverage/test_coverage.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/coverage/test_coverage.rb: add a test for restart. a patchmame2011-06-131-0/+26
| | | | | | from Xavier Shay. [ruby-core:36745] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/coverage/test_coverage.rb: added.nobu2010-08-141-0/+17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e