aboutsummaryrefslogtreecommitdiffstats
path: root/test/lib
Commit message (Collapse)AuthorAgeFilesLines
* assertions.rb: fix return in assert_raisenobu2017-11-021-4/+6
| | | | | | | * 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
* multiple arguments to writenobu2017-10-231-1/+1
| | | | | | | 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
* Use caller with length to reduce unused stringskazu2017-10-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* envutil.rb: precommand in invoke_ruby [ci skip]nobu2017-10-151-2/+2
| | | | | | | * 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
* Remove unnecessary `require 'thread'`kazu2017-10-081-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* assertions.rb: AllFailures#message encodingnobu2017-08-011-1/+2
| | | | | | | | * 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
* assertions.rb: frozen string buffernobu2017-07-161-2/+2
| | | | | | | * 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
* assertions.rb: syntax_check for other implnobu2017-07-081-3/+19
| | | | | | | | | * 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
* catch up frozen_string_literal: true.ko12017-06-221-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fixed missing handling for frozen object at r59121.hsbt2017-06-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Specify frozen_string_literal: true.hsbt2017-06-2017-21/+21
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/unit.rb: close jobservernobu2017-06-181-4/+7
| | | | | | | | * 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
* test: attempt to reduce failures in assert_cpu_usage_lownormal2017-06-031-1/+15
| | | | | | | | | | | | | | 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
* test_rubyoptions.rb: ruby-runner sets $0 to install name nownobu2017-05-301-3/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tests: increase CPU percentage threshold for assert_cpu_usage_lownormal2017-05-281-1/+1
| | | | | | | | | | | | | | 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
* test for IO.copy_stream CPU usage (r58534)normal2017-05-271-0/+7
| | | | | | | | | | | 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
* use timeout scale.ko12017-05-251-4/+12
| | | | | | | | | | * 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
* assertions.rb: AllFailures#foreachnobu2017-05-241-0/+19
| | | | | | | * 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
* test/unit.rb: fix returning job tokensnobu2017-05-161-3/+8
| | | | | | | * 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
* fix wordsnaruse2017-05-161-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix up r57167nobu2017-05-101-1/+2
| | | | | | | * 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
* Add diagnostic reports section header [ci skip]nobu2017-04-231-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* assert_syntax_error returns the exception [ci skip]nobu2017-04-231-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: refine stream closed messagenobu2017-04-092-2/+2
| | | | | | | | * 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
* test/unit.rb: no jobserver in workersnobu2017-04-091-3/+0
| | | | | | | * 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
* fix condition of assert_not_respond_tonobu2017-04-071-1/+1
| | | | | | | * 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
* assert_not_respond_to private methodnobu2017-04-071-0/+23
| | | | | | | * 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
* assert_respond_to non-private methodnobu2017-04-071-5/+8
| | | | | | | * 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
* envutil.rb: basename for diagnostic_reportsnobu2017-03-141-2/+2
| | | | | | | * 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
* Supress warning: instance variable @repeat_count not initializednaruse2017-03-071-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test: use RbConfig::Limitsnobu2017-03-021-5/+3
| | | | | | | | * 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
* assertions.rb: ignore exit in childnobu2017-02-201-4/+3
| | | | | | | * 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
* envutil.rb: diagnostic_reports for ruby-runnernobu2017-02-202-9/+13
| | | | | | | * 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
* parallel.rb: fix interventionnobu2017-02-101-2/+1
| | | | | | | | * 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
* test/unit.rb: old GNU makenobu2017-02-071-1/+1
| | | | | | | | * 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
* test/unit.rb: most-assertednobu2017-02-071-9/+27
| | | | | | | * 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
* test/unit.rb: definednobu2017-02-071-1/+1
| | | | | | | * 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
* test/unit: record in parallelnobu2017-02-072-0/+31
| | | | | | | | | | * 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
* test/unit.rb: statisticsnobu2017-02-071-0/+34
| | | | | | | * 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
* @job_tokens is defined iff @jobserver is truenaruse2017-02-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/unit.rb: jobserver for workersnobu2017-02-041-3/+4
| | | | | | | | * 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
* test/unit.rb: job tokensnobu2017-02-041-9/+15
| | | | | | | * 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
* test/unit.rb: initialize instance variablenobu2017-02-041-0/+1
| | | | | | | * 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
* test/unit.rb: share job slotsnobu2017-02-031-1/+32
| | | | | | | * 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
* test/unit.rb: job testing flagnobu2017-02-031-7/+3
| | | | | | | * 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
* test/unit.rb: minimum workersnobu2017-01-281-1/+1
| | | | | | | * 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
* leakchecker.rb: get rid of uninitialized Tempfilenobu2017-01-271-1/+3
| | | | | | | | * test/lib/leakchecker.rb (LeakChecker#find_tempfiles): get rid of errors on uninitialized Tempfile, which can be left when Dir.tmpdir failed or by Tempfile.allocate. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix a typo [ci skip]kazu2017-01-161-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/unit.rb: restore parallel optionnobu2016-12-241-0/+2
| | | | | | | * test/lib/test/unit.rb (_run_parallel): restore parallel option after retrying for --repeat-count option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/unit.rb: --subprocess-timeout-scale optionnobu2016-12-242-0/+24
| | | | | | | | | | * test/lib/envutil.rb (EnvUtil#invoke_ruby): add subprocess timeout scaling factor. * test/lib/test/unit.rb (Test::Unit::SubprocessOption): add --subprocess-timeout-scale option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e