summaryrefslogtreecommitdiff
path: root/test/ruby
AgeCommit message (Collapse)Author
2020-04-27Moved already resolved testNobuyoshi Nakada
Couldn't figure out failed/fixed versions.
2020-04-27test/ruby/test_fiber.rb (test_stack_size): re-enabled on s390xYusuke Endoh
Revert 9948addda67f4b7a6e3575f1eba9025f998811d2. It is now discussed in https://bugs.ruby-lang.org/issues/16814, and an assert is added with a217d3cedce3f5aa5c27a1ce6c72b65ec37da057. It would be good to give it a try.
2020-04-23Test for [Bug #16669]Nobuyoshi Nakada
2020-04-23Split test_definedNobuyoshi Nakada
2020-04-22Made parentheses mandatory in endless method defitionNobuyoshi Nakada
Even for empty argument list, not to be confusing with a writer method name. Notes: Merged: https://github.com/ruby/ruby/pull/3051
2020-04-22Disallow R-assign in endless defNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3051
2020-04-22Revert "Allow simple R-assign in endless def"Nobuyoshi Nakada
This reverts commit 67bcac879a2e0ddfb4e7bbd7cb5e5401422de76a. Notes: Merged: https://github.com/ruby/ruby/pull/3051
2020-04-22test/ruby/test_fiber.rb: Skip the problematic test_stack_size on riscvYusuke Endoh
Since it is impossible to detect stack overflow of C functions robustly, the test is a bit unreasonable. https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian-riscv64/ruby-master/log/20200421T120018Z.fail.html.gz
2020-04-21eval_error.c: default nil as "reverse" is now false [Feature #8661]Nobuyoshi Nakada
2020-04-21test/ruby/test_refinement.rb: extend the timeoutYusuke Endoh
https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian-riscv64/ruby-master/log/20200420T083601Z.fail.html.gz
2020-04-19Skip TestRequire#test_loading_fifo_fd_leak on AndroidYusuke Endoh
The test fails due to unknown reason. Need to debug in future, but tentatively skipped.
2020-04-18Environment variable values are not case-insensitiveNobuyoshi Nakada
Only the names are case-sensitive. Notes: Merged: https://github.com/ruby/ruby/pull/3041
2020-04-18Compare environment variable names in those manor [Bug #16798]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3040
2020-04-18Make sure newarraykwsplat accesses a correct indexTakashi Kokubun
on stack when local_stack_p is enabled. This fixes `RB_FL_TEST_RAW:"RB_FL_ABLE(obj)"` assertion failure on power_assert's test with JIT enabled.
2020-04-18Super TestJIT#setup to skip unsupported envsTakashi Kokubun
Slightly simplifying 8d6aa06620b316904fd10d0cab1b85e07f2fbf67
2020-04-18Skip a too-unstable test on s390x-linuxTakashi Kokubun
In the last 26-ish hours, it has failed 5 times: https://travis-ci.org/github/ruby/ruby/jobs/676497718 https://travis-ci.org/github/ruby/ruby/jobs/676480295 https://travis-ci.org/github/ruby/ruby/jobs/676103216 https://travis-ci.org/github/ruby/ruby/jobs/676057967 https://travis-ci.org/github/ruby/ruby/jobs/676055113 and I don't think anybody has been working on it right now. To make CI result report of s390x-linux useful, let's skip it until the test is improved to be more stable.
2020-04-18test/ruby/test_jit_debug.rb: Skip unsupported platformsYusuke Endoh
2020-04-17test/ruby/test_process.rb: Skip GID.from_name on AndroidYusuke Endoh
The user management on Android seems very different https://rubyci.org/logs/rubyci.s3.amazonaws.com/android28-x86_64/ruby-master/log/20200416T234122Z.fail.html.gz
2020-04-16Preserve encoding in error messages for invalid user/group nameNobuyoshi Nakada
2020-04-16Added tests for Process::UID.from_name and Process::GID.from_nameNobuyoshi Nakada
2020-04-16Preserve encoding in error message for invalid env exec optionNobuyoshi Nakada
2020-04-16Added test for invalid env exec optionNobuyoshi Nakada
2020-04-15Added test for `debug_level:` option of `RubyVM::InstructionSequence.compile`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3033
2020-04-14This test is not testing attr_writerTakashi Kokubun
2020-04-14Invalidate fastpath when calling attr_reader by superTakashi Kokubun
The same bug as 8355a99883 existed in attr_reader too.
2020-04-14Invalidate fastpath when calling attr_writer by superTakashi Kokubun
We started to use fastpath on invokesuper when a method is not refinements since 5c27681813, but we shouldn't have used fastpath for attr_writer either. `cc->aux_.attr_index` is for an actual receiver class, while we store its superclass in `cc->klass` and therefore there's no way to properly invalidate attr_writer's inline cache when it's called by super. [Bug #16785] I suspect the same bug also exists in attr_reader. I'll address that in another commit.
2020-04-15Disallow line-continuation before R-assignNobuyoshi Nakada
2020-04-13Allow simple R-assign in endless defNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3025
2020-04-12Relaxed of R-assign value to argNobuyoshi Nakada
2020-04-11Assertions for basic use of `encoding:` optionNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3018
2020-04-11Assertions for enumerators of DirNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3018
2020-04-11Removed unnecessary `to_a` callNobuyoshi Nakada
`Dir.entries` returns an array. Notes: Merged: https://github.com/ruby/ruby/pull/3018
2020-04-11Silence broken pipe error messages on STDOUT [Feature #14413]Nobuyoshi Nakada
Raise `SignalException` for SIGPIPE to abort when EPIPE occurs. Notes: Merged: https://github.com/ruby/ruby/pull/3013 Merged-By: nobu <nobu@ruby-lang.org>
2020-04-10Endless method definition [Feature #16746]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2996
2020-04-10Rightward-assign by ASSOCNobuyoshi Nakada
[Feature #15921] Notes: Merged: https://github.com/ruby/ruby/pull/3012
2020-04-08Fixed formatted substring expansion [Bug #16767]Nobuyoshi Nakada
2020-04-07Fix source location of autoloaded constant [Bug #16764]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3009
2020-03-30Optimize exivar access on JIT-ed getivarTakashi Kokubun
JIT support of dd723771c11. $ benchmark-driver -v --rbenv 'before;before --jit;after --jit' benchmark/mjit_exivar.yml --repeat-count=4 before: ruby 2.8.0dev (2020-03-30T12:32:26Z master e5db3da9d3) [x86_64-linux] before --jit: ruby 2.8.0dev (2020-03-30T12:32:26Z master e5db3da9d3) +JIT [x86_64-linux] after --jit: ruby 2.8.0dev (2020-03-31T05:57:24Z mjit-exivar 128625baec) +JIT [x86_64-linux] Calculating ------------------------------------- before before --jit after --jit mjit_exivar 57.944M 53.579M 54.471M i/s - 200.000M times in 3.451588s 3.732772s 3.671687s Comparison: mjit_exivar before: 57944345.1 i/s after --jit: 54470876.7 i/s - 1.06x slower before --jit: 53579483.4 i/s - 1.08x slower
2020-03-28Clean up /tmp leftovers in ci.rvm.jpTakashi Kokubun
2020-03-27Set external encoding correctly for File.open('f', FILE::BINARY) on WindowsJeremy Evans
Previously, the external encoding was only set correctly for File::BINARY if keyword arguments were provided. This copies the logic for the keyword arguments case to the no keyword arguments case. Possibly it should be refactored into a separate function. Fixes [Bug #16737] Notes: Merged: https://github.com/ruby/ruby/pull/2985
2020-03-25Fixed crash when argument array is modifiedNobuyoshi Nakada
2020-03-24test/json/test_helper.rb: Do not add a relative path to $LOAD_PATHYusuke Endoh
... because it conflicts with test/ruby/test_m17n.rb. An exception `incompatible character encodings: UTF-8 and UTF-16BE` occurs when: * a non-existence relative path is added to $LOAD_PATH, * ASCII-incompatible encoding is set to default_external, and * some file is loaded. ``` $LOAD_PATH << "no_existing_dir" Encoding.default_external = Encoding::UTF_16BE load "dummy.rb" #=> incompatible character encodings: UTF-8 and UTF-16BE ``` This issue can be actually observed by a combination of out-of-place build and the following command: make test-all TESTS="json ruby/m17n -n test_object_inspect_external" http://ci.rvm.jp/logfiles/brlog.trunk-test-random.20200322-221411 ASCII-incompatible default external encoding assumes that the cwd is the encoding, and it is attempted to beconcatenated with a non-existence relative LOAD_PATH UTF-8 string, which causes the exception. This changeset avoids a relative path.
2020-03-23test/ruby/test_m17n.rb: Update the debugging code to get C stacktraceYusuke Endoh
2020-03-23test/ruby/test_m17n.rb: Make the debugging code print to stderrYusuke Endoh
The test is executed with -j8, so printing someting to stdout may break.
2020-03-22Merge pull request #2721 from jeremyevans/method-inspect-chain-alias-11188Jeremy Evans
Correctly show defined class for aliases of aliases Notes: Merged-By: jeremyevans <code@jeremyevans.net>
2020-03-22Support obj.clone(freeze: true) for freezing cloneJeremy Evans
This freezes the clone even if the receiver is not frozen. It is only for consistency with freeze: false not freezing the clone even if the receiver is frozen. Because Object#clone is now partially implemented in Ruby and not fully implemented in C, freeze: nil must be supported to provide the default behavior of only freezing the clone if the receiver is frozen. This requires modifying delegate and set, to set freeze: nil instead of freeze: true as the keyword parameter for initialize_clone. Those are the two libraries in stdlib that override initialize_clone. Implements [Feature #16175] Notes: Merged: https://github.com/ruby/ruby/pull/2969
2020-03-22test/ruby/test_m17n.rb: Add a temporal code for debuggingYusuke Endoh
http://ci.rvm.jp/logfiles/brlog.trunk-test-random.20200322-221411 ``` I, [2020-03-22T22:15:50.761950 #23076] INFO -- : 1) Error: I, [2020-03-22T22:15:50.761963 #23076] INFO -- : TestM17N#test_object_inspect_external: I, [2020-03-22T22:15:50.761974 #23076] INFO -- : Encoding::CompatibilityError: incompatible character encodings: UTF-8 and UTF-16BE ```
2020-03-22test/ruby/test_fiber.rb (test_many_fibers_with_threads): relax timeoutYusuke Endoh
This test takes 40..50 seconds under Solaris 11, so the timeout (60 seconds) was too strict. This change increases it to 180 seconds. https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20200322T100007Z.fail.html.gz ``` 1) Error: TestFiber#test_many_fibers_with_threads: Timeout::Error: execution of assert_normal_exit expired timeout (60 sec) ```
2020-03-18Ignore TestJITDebug in mswin RubyCI for nowTakashi Kokubun
It's still pending to be implemented. To be enabled later when it's implemented.
2020-03-17Reduce allocations for keyword argument hashesJeremy Evans
Previously, passing a keyword splat to a method always allocated a hash on the caller side, and accepting arbitrary keywords in a method allocated a separate hash on the callee side. Passing explicit keywords to a method that accepted a keyword splat did not allocate a hash on the caller side, but resulted in two hashes allocated on the callee side. This commit makes passing a single keyword splat to a method not allocate a hash on the caller side. Passing multiple keyword splats or a mix of explicit keywords and a keyword splat still generates a hash on the caller side. On the callee side, if arbitrary keywords are not accepted, it does not allocate a hash. If arbitrary keywords are accepted, it will allocate a hash, but this commit uses a callinfo flag to indicate whether the caller already allocated a hash, and if so, the callee can use the passed hash without duplicating it. So this commit should make it so that a maximum of a single hash is allocated during method calls. To set the callinfo flag appropriately, method call argument compilation checks if only a single keyword splat is given. If only one keyword splat is given, the VM_CALL_KW_SPLAT_MUT callinfo flag is not set, since in that case the keyword splat is passed directly and not mutable. If more than one splat is used, a new hash needs to be generated on the caller side, and in that case the callinfo flag is set, indicating the keyword splat is mutable by the callee. In compile_hash, used for both hash and keyword argument compilation, if compiling keyword arguments and only a single keyword splat is used, pass the argument directly. On the caller side, in vm_args.c, the callinfo flag needs to be recognized and handled. Because the keyword splat argument may not be a hash, it needs to be converted to a hash first if not. Then, unless the callinfo flag is set, the hash needs to be duplicated. The temporary copy of the callinfo flag, kw_flag, is updated if a hash was duplicated, to prevent the need to duplicate it again. If we are converting to a hash or duplicating a hash, we need to update the argument array, which can including duplicating the positional splat array if one was passed. CALLER_SETUP_ARG and a couple other places needs to be modified to handle similar issues for other types of calls. This includes fairly comprehensive tests for different ways keywords are handled internally, checking that you get equal results but that keyword splats on the caller side result in distinct objects for keyword rest parameters. Included are benchmarks for keyword argument calls. Brief results when compiled without optimization: def kw(a: 1) a end def kws(**kw) kw end h = {a: 1} kw(a: 1) # about same kw(**h) # 2.37x faster kws(a: 1) # 1.30x faster kws(**h) # 2.19x faster kw(a: 1, **h) # 1.03x slower kw(**h, **h) # about same kws(a: 1, **h) # 1.16x faster kws(**h, **h) # 1.14x faster Notes: Merged: https://github.com/ruby/ruby/pull/2945