summaryrefslogtreecommitdiff
path: root/test/lib
AgeCommit message (Collapse)Author
2017-11-27Ignore failures related to threading.ko1
* test/lib/tracepointchecker.rb: ignore "deletion trace" check when there are threads other than the main thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-26leakchecker.rb: no conversionnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-16cleanup hook cleanup code.ko1
* vm_trace.c: before this patch, deleted hooks are remvoed at *the beggining* of hooks (exec_hooks_precheck). This patch cleanup deleted hooks at (1) just after hook is deleted (TracePoint#disable and so on) (2) just after executing hooks (exec_hooks_postcheck) Most of time (1) is enough, but if some threads running hooks, we need to wait cleaning up deleted hooks until threads finish running the hooks. This is why (2) is introduced (and this is why current impl cleanup deleted hooks at the beggining of hooks). * test/lib/tracepointchecker.rb: check also the number of delete waiting hooks. * cont.c (cont_restore_thread): fix VM->trace_running count. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-13envutil.rb: preserve RUBYLIBnobu
* test/lib/envutil.rb (invoke_ruby): preserve RUBYLIB which is set by runruby.rb and necessary to load standard libraries. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-02assertions.rb: fix return in assert_raisenobu
* test/lib/test/unit/assertions.rb (assert_raise): should fail if returned gently in the given block without any exceptions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23multiple arguments to writenobu
Make write methods of IO-like objects accept multiple arguments, as well as IO#write. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Use caller with length to reduce unused stringskazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-15envutil.rb: precommand in invoke_ruby [ci skip]nobu
* test/lib/envutil.rb (invoke_ruby): add precommand option to invoke ruby via some other commands, e.g., sudo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-08Remove unnecessary `require 'thread'`kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-01assertions.rb: AllFailures#message encodingnobu
* test/lib/test/unit/assertions.rb (AllFailures#message): put indented messages back to the original encoding, to get rid of Encoding::CompatibilityError when key has non-ASCII characters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-16assertions.rb: frozen string buffernobu
* test/lib/test/unit/assertions.rb (assert_pattern_list): make frozen string literals modifiable as buffers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-08assertions.rb: syntax_check for other implnobu
* test/lib/test/unit/assertions.rb (syntax_check): use eval instead of RubyVM::InstructionSequence.compile so that other implementations can share the tests. [ruby-core:81935] [Bug #13723] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-22catch up frozen_string_literal: true.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-20Fixed missing handling for frozen object at r59121.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-20Specify frozen_string_literal: true.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-18test/unit.rb: close jobservernobu
* test/lib/test/unit.rb (Test::Unit::Parallel#flush_job_tokens): close jobserver auth fds aflter flush, not to release tokens more than acquired. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-03test: attempt to reduce failures in assert_cpu_usage_lownormal
Try to make this test less fragile by taking into account the worst case kernel timing resolution. [ruby-core:81540] * test/lib/test/unit/assertions.rb (assert_cpu_usage_low): clamp measurement to minimum measurable time and warn about tests being too short to measure * test/ruby/test_io.rb (test_copy_stream_no_busy_wait): remove pct kwarg and rely on assert_cpu_usage_low defaults git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30test_rubyoptions.rb: ruby-runner sets $0 to install name nownobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28tests: increase CPU percentage threshold for assert_cpu_usage_lownormal
When sleeping for the tick rate of 100ms (defined in thread_pthread.c) as we do in test/ruby/test_io.rb (test_copy_stream_no_busy_wait), it may not be possible to measure with <= 10ms resolution on 100HZ systems (CONFIG_HZ in the Linux kernel). So increase the threshold to 15ms (10ms + 5ms slack for slow systems). * test/lib/test/unit/assertions.rb (assert_cpu_usage_low): increase pct default value [ruby-core:81427] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27test for IO.copy_stream CPU usage (r58534)normal
I'm likely to make similar mistakes in the future when working on Fiber auto-scheduling. Start adding assertions for existing code, first. * test/ruby/test_io.rb (test_copy_stream_no_busy_wait): added * test/lib/test/unit/assertions.rb (assert_cpu_usage_low): added git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-25use timeout scale.ko1
* test/lib/envutil.rb: introduce EnvUtil.apply_timeout_scale to use this scale from outside. * test/ruby/test_thread.rb (test_fork_in_thread): respect timeout scale. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-24assertions.rb: AllFailures#foreachnobu
* test/lib/test/unit/assertions.rb (AllFailures#foreach): shortcircuit for `each` and `AllFailures#for`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-16test/unit.rb: fix returning job tokensnobu
* test/lib/test/unit.rb (_run_parallel): flush job tokens after quitting workers when normally finished too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-16fix wordsnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-10fix up r57167nobu
* test/lib/minitest/unit.rb (MiniTest::Unit#_run_anything): stop if any errors or failures. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-23Add diagnostic reports section header [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-23assert_syntax_error returns the exception [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-09thread.c: refine stream closed messagenobu
* thread.c (Init_Thread): [EXPERIMENTAL] refine the "stream closed" special exception message, by explicating that it is caused by threading. [ruby-core:80583] [Bug #13405] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-09test/unit.rb: no jobserver in workersnobu
* test/lib/test/unit.rb (Test::Unit::Parallel#process_args): worker processes do not access job server. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-07fix condition of assert_not_respond_tonobu
* test/lib/test/unit/assertions.rb (assert_not_respond_to): fix condition to assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-07assert_not_respond_to private methodnobu
* test/lib/test/unit/assertions.rb (assert_not_respond_to): allow private flag as well as assert_respond_to. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-07assert_respond_to non-private methodnobu
* test/lib/test/unit/assertions.rb (assert_respond_to): do not call super class assert_respond_to when false priv is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-14envutil.rb: basename for diagnostic_reportsnobu
* test/lib/envutil.rb (EnvUtil.diagnostic_reports): diagnostic report file uses base name only. [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-07Supress warning: instance variable @repeat_count not initializednaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-02test: use RbConfig::Limitsnobu
* test/lib/envutil.rb: rbconfig/sizeof may not be available when cross-compiling. use RbConfig::Limits instead of calculating limits of Fixnum with hard-coded CHAR_BIT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-20assertions.rb: ignore exit in childnobu
* test/lib/test/unit/assertions.rb (assert_separately): ignore SystemExit. unsuccessful exit still fails an assertion later. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-20envutil.rb: diagnostic_reports for ruby-runnernobu
* test/lib/envutil.rb (EnvUtil.diagnostic_reports): ruby-runner execs "RUBY_INSTALL_NAME" file, so search by that name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-10parallel.rb: fix interventionnobu
* test/lib/test/unit/parallel.rb (_report): send a response and a newline atomically, to get rid of intervention with "p" which runs in a separate thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-07test/unit.rb: old GNU makenobu
* test/lib/test/unit.rb (Test::Unit::Parallel#non_options): support old GNU make, which uses --jobserver-fds option instead of --jobserver-auth. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-07test/unit.rb: most-assertednobu
* test/lib/test/unit.rb (Statistics#record): record most asserted tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-07test/unit.rb: definednobu
* test/lib/test/unit.rb (Test::Unit::Statistics#record): check if @longest is set first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-07test/unit: record in parallelnobu
* test/lib/test/unit.rb (Test::Unit::Parallel#deal): deal with record. * test/lib/test/unit/parallel.rb (Test::Unit::Worker#record): report test records to the master. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-07test/unit.rb: statisticsnobu
* test/lib/test/unit.rb (Test::Unit::Statistics): show statistics. only --longest option is implemented right now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-05@job_tokens is defined iff @jobserver is truenaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-04test/unit.rb: jobserver for workersnobu
* test/lib/test/unit.rb (Test::Unit::Parallel#process_args): initialize @run_options to pass jobserver auth pipes to worker processes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-04test/unit.rb: job tokensnobu
* test/lib/test/unit.rb (_run_parallel): deal with job tokens for each workers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-04test/unit.rb: initialize instance variablenobu
* test/lib/test/unit.rb (Test::Unit::Parallel#non_options): initialize @jobserver instance variable to suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-03test/unit.rb: share job slotsnobu
* test/lib/test/unit.rb (Test::Unit::Parallel#_run_parallel): share job slots with GNU 'make'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-03test/unit.rb: job testing flagnobu
* test/lib/test/unit.rb (Parallel#non_options): split testing flag and job count by OptionParser. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-28test/unit.rb: minimum workersnobu
* test/lib/test/unit.rb (_run_parallel): launch only necessary workers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e