Граф коммитов

13228 Коммитов

Автор SHA1 Сообщение Дата
Matt Muller 92a238a21c
[ruby/uri] Add support for WebSockets
https://github.com/ruby/uri/commit/805a95786a
2020-03-26 18:06:14 +09:00
aycabta 8911b3d3e8 [ruby/reline] Add a comment why rescue yamatanooroti loading error on the test
https://github.com/ruby/reline/commit/2a8061daec
2020-03-26 17:41:21 +09:00
aycabta 467b665a8b [ruby/reline] Rename test suite name of yamatanooroti test
https://github.com/ruby/reline/commit/b0f32f5de4
2020-03-26 17:41:21 +09:00
aycabta 9339a7d9d4 [ruby/reline] Add yamatanooroti rendering test
https://github.com/ruby/reline/commit/f092519525
2020-03-26 17:41:21 +09:00
aycabta 90913bfabe [ruby/reline] Suppress error in case INPUTRC env is empty
https://github.com/ruby/reline/commit/bce7e7562b
2020-03-26 17:41:21 +09:00
aycabta f245fb1ab8 [ruby/reline] Work with wrong $/ value correctly
https://github.com/ruby/reline/commit/962ebf5a1b
2020-03-26 17:41:21 +09:00
aycabta 22477128cd [ruby/irb] Suppress crashing when EncodingError has occurred without lineno
https://github.com/ruby/irb/commit/13572d8cdc
2020-03-26 17:41:21 +09:00
Takashi Kokubun ba04678c98
Ignore test_getbinaryfile for --jit-wait
To fix this properly, we'd need to configure timeout for the server and
the client because waiting for compilation takes time.

Until we figure out how to do it, let me skip this.
2020-03-25 22:54:23 -07:00
Nobuyoshi Nakada 4adb2d655d
Make RbConfig::CONFIG values mutable [Bug #16738]
As `RbConfig.expand` modifies the argument and involved `CONFIG`
values, its values should be mutable.
2020-03-25 22:09:28 +09:00
Nobuyoshi Nakada c7d668801b
Fixed crash when argument array is modified 2020-03-25 01:23:03 +09:00
Yusuke Endoh 1b3339528c Skip a test that attempts to remove the current directory on Solaris 2020-03-24 17:43:33 +09:00
Yusuke Endoh 12a3671a9b test/rubygems: Try not only /usr/bin/env but also /bin/env
RubyGems chooses available one from the two: /usr/bin/env or /bin/env

20b0d60948/lib/rubygems/installer.rb (L38)

So, it is good not to hard-code /usr/bin/env in tests.

This is a retry of 65201c054a which was
accidentally deleted by 96064e6f1c
2020-03-24 17:21:55 +09:00
David Rodríguez 96064e6f1c
Sync rubygems with current master (#2889) 2020-03-24 15:39:24 +09:00
Yusuke Endoh c565dfb09a test/json/test_helper.rb: Do not add a relative path to $LOAD_PATH
... 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-24 10:45:52 +09:00
Yusuke Endoh 1d996fe72f test/ruby/test_m17n.rb: Update the debugging code to get C stacktrace 2020-03-23 10:55:09 +09:00
Yusuke Endoh 1c05682929 test/ruby/test_m17n.rb: Make the debugging code print to stderr
The test is executed with -j8, so printing someting to stdout may break.
2020-03-23 02:13:28 +09:00
Jeremy Evans adecd43197
Merge pull request #2721 from jeremyevans/method-inspect-chain-alias-11188
Correctly show defined class for aliases of aliases
2020-03-22 09:30:20 -07:00
Jeremy Evans 4f7b435c95 Support obj.clone(freeze: true) for freezing clone
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]
2020-03-22 09:30:07 -07:00
Yusuke Endoh 095e9f57af test/ruby/test_m17n.rb: Add a temporal code for debugging
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-22 22:34:49 +09:00
Yusuke Endoh 6ab7d439f8 test/ruby/test_fiber.rb (test_many_fibers_with_threads): relax timeout
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-22 21:58:18 +09:00
Yusuke Endoh 5908914ea2 test/net/http/test_http.rb: relax open_timeout limit
The test fails randomly on the CI of OpenCSW SPARC Solaris 10:

https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10s/ruby-master/log/20200321T091909Z.fail.html.gz
```
  1) Failure:
TestNetHTTP_v1_2_chunked#test_timeout_during_HTTP_session [/export/home/rubyci/unstable10s/tmp/build/20200321T091909Z/ruby/test/net/http/test_http.rb:575]:
[Net::ReadTimeout] exception expected, not #<Net::OpenTimeout: execution expired>.
```

The environment uses RUBY_TEST_SUBPROCESS_TIMEOUT_SCALE=20, so the open
timeout 0.1 sec. means 2.0 sec. for the environment, but it seems too
strict because the environment is painfully slow.
2020-03-21 23:09:17 +09:00
Yusuke Endoh be76e86e69 test/openssl/test_ssl.rb: ignore SSLError when the connection is closed
"test_close_after_socket_close" checks if ssl.close is no-op even after
the wrapped socket is closed.  The test itself is fair, but the other
endpoint that is reading the SSL connection may fail with SSLError:
"SSL_read: unexpected eof while reading" in some environments:

https://github.com/ruby/ruby/actions/runs/60085389 (MinGW)
https://rubyci.org/logs/rubyci.s3.amazonaws.com/android28-x86_64/ruby-master/log/20200321T034442Z.fail.html.gz
```
  1) Failure:
OpenSSL::TestSSL#test_close_after_socket_close [D:/a/ruby/ruby/src/test/openssl/utils.rb:299]:
exceptions on 1 threads:
SSL_read: unexpected eof while reading
```

This changeset rescues and ignores the SSLError in the test.
2020-03-21 15:46:33 +09:00
Takashi Kokubun 79b4aca94c
Ignore TestJITDebug in mswin RubyCI for now
It's still pending to be implemented. To be enabled later when it's
implemented.
2020-03-18 18:38:31 -07:00
Jeremy Evans d2c41b1bff Reduce allocations for keyword argument hashes
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
2020-03-17 12:09:43 -07:00
Jeremy Evans ac04b778c1 Make {**{}} return unfrozen empty hash
Previously, method call keyword splats and hash keyword splats
were compiled exactly the same.  This is because parse-wise, they
operate on indentical nodes when it comes to compiling the **{}.

Fix this by using an ugly hack of temporarily modifying the
nd_brace flag in the method call keyword splat case.  Inside
compile_hash, only optimize the **{} case for hashes where the
nd_brace flag has been modified to reflect we are in the method
call keyword splat case and it is safe to do so.

Since compile_keyword_args is only called in one place, move the
keyword_node_p call out of that method to the single caller to
avoid duplicating the code.
2020-03-17 12:09:43 -07:00
Yusuke Endoh d514ba8e17 `Proc` made by `Hash#to_proc` should be a lambda [Bug #12671]
Like `Symbol#to_proc` (f0b815dc67)
2020-03-16 23:38:26 +09:00
Yusuke Endoh 47141797be hash.c: Do not use the fast path (rb_yield_values) for lambda blocks
As a semantics, Hash#each yields a 2-element array (pairs of keys and
values).  So, `{ a: 1 }.each(&->(k, v) { })` should raise an exception
due to lambda's arity check.
However, the optimization that avoids Array allocation by using
rb_yield_values for blocks whose arity is more than 1 (introduced at
b9d2960337 and some commits), seemed to
overlook the lambda case, and wrongly allowed the code above to work.

This change experimentally attempts to make it strict; now the code
above raises an ArgumentError.  This is an incompatible change; if the
compatibility issue is bigger than our expectation, it may be reverted
(until Ruby 3.0 release).

[Bug #12706]
2020-03-16 23:17:12 +09:00
Jean Boussier e257c08f2e
[ruby/stringio] StringIO#initialize default to the source string encoding
[Bug #16497]

https://github.com/ruby/stringio/commit/4958a5ccab
2020-03-15 18:43:01 +09:00
Takashi Kokubun 67fbc122fb
Resurrect test_jit_debug.rb
Revert "Temporarily drop test_jit_debug.rb"

This reverts commit 5437d7c879.

Skipped some CIs which were failing previously.
2020-03-14 21:13:31 -07:00
Takashi Kokubun a90117c8c9
Skip test_abort_tls with --jit-wait for now
Perhaps the server blocks for an unexpectedly long time by waiting for
JIT. As it's usually passing, I don't think it's detecting a bug.
2020-03-12 18:43:03 -07:00
Yusuke Endoh c6633f21a4 Update some syslog tests to absurb the format change of FreeBSD syslog
FreeBSD

```
$ ruby -rsyslog -e 'Syslog.open("rubyspec", Syslog::LOG_PERROR) {|s| s.log(Syslog::LOG_ALERT, "Hello") }'
rubyspec 78462 - - Hello
```

Linux

```
$ ruby -rsyslog -e 'Syslog.open("rubyspec", Syslog::LOG_PERROR) {|s| s.log(Syslog::LOG_ALERT, "Hello") }'
rubyspec: Hello
```

591ef7c807
2020-03-12 15:30:20 +09:00
Takashi Kokubun e0512b29aa
Let Net::HTTP.get take request headers (#2957)
* Let Net::HTTP.get take request headers

* Add more test cases for no header usages

* Add examples with request headers

* Add a NEWS entry [ci skip]

[Feature #16686]
2020-03-10 22:26:22 -07:00
Koichi Sasada 2943ff9d44 fix bug on method cache invalidation.
To invalidate cached method entry, existing method entry (ment)
is marked as invalidated and replace with copied ment. However,
complemented method entry (method entries in Module) should not
be set to Module's m_tbl.
[Bug #16669]
2020-03-11 02:50:44 +09:00
Kazuki Yamaguchi e4a26cd4f8 openssl: sync with upstream repository
Import current master (2c43241dc0ed) of ruby/openssl.git.

Below are the commits that were made since the last batch at commit
b99775b163 (ruby/openssl.git commit f49e7110ca1e). Note that some of
them have been applied already.

----------------------------------------------------------------
Benoit Daloze (1):
      Remove redundant and ignored workflow file

DBL-Lee (1):
      add support for SHA512_256/SHA512_224

Hiroshi SHIBATA (2):
      Guard for OpenSSL::PKey::EC::Group::Error with unsupported platforms
      Fixed inconsistency directory structure with ruby/ruby repo

Jeremy Evans (2):
      Fix keyword argument separation issues in OpenSSL::SSL::SSLSocket#sys{read,write}_nonblock
      Remove taint support

Kazuki Yamaguchi (26):
      config: support .include directive
      random: make OpenSSL::Random.pseudo_bytes alias of .random_bytes
      extconf.rb: get rid of -Werror=deprecated-declarations
      test/openssl/test_ssl: skip test_fallback_scsv if necessary
      ts: simplify OpenSSL::Timestamp::Request#algorithm
      History.md: add missing references to GitHub issues
      config: deprecate OpenSSL::Config#add_value and #[]=
      test/openssl/test_ssl: remove sleep from test_finished_messages
      test/openssl/test_ssl: fix random failure in SSLSocket.open test
      test/openssl/test_ssl: avoid explicitly-sized private keys
      test/openssl/test_ssl: remove commented-out test case
      test/openssl/test_ssl: allow kRSA tests to fail
      ssl: avoid declarations after statements
      engine: revert OpenSSL::Engine.load changes for cloudhsm
      engine: remove really outdated static engines
      engine: do not check for ENGINE_load_builtin_engines()
      engine: fix guards for 'dynamic' and 'cryptodev' engines
      lib/openssl.rb: require openssl/version.rb
      x509: add error code and verify flags constants
      ssl: set verify error code in the case of verify_hostname failure
      .github/workflows: merge CI jobs into a single workflow
      .github/workflows: test against different OpenSSL versions
      .travis.yml: fully migrate to GitHub Actions
      ssl: suppress test failure with SSLContext#add_certificate_chain_file
      ssl: remove test case test_puts_meta from test_pair
      Revert "Use version.rb in gemspec"

MSP-Greg (2):
      .travis.yml - remove 2.3/1.0.2, 2.5/1.1.1, head/1.0.2
      Use version.rb in gemspec

Samuel Williams (1):
      Restore compatibility with older versions of Ruby.

Yusuke Endoh (1):
      Make OpenSSL::OSSL#test_memcmp_timing robust
2020-03-10 17:41:01 +09:00
Jeremy Evans e02bd0e713
Don't display singleton class in Method#inspect unless method defined there
Previously, if an object has a singleton class, and you call
Object#method on the object, the resulting string would include
the object's singleton class, even though the method was not
defined in the singleton class.

Change this so the we only show the singleton class if the method
is defined in the singleton class.

Fixes [Bug #15608]
2020-03-09 07:57:16 -07:00
Takashi Kokubun d8fcc67642
Skip test_06_timeout for --jit-wait CI
This test has been too unstable on trunk-mjit-wait
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2782206
2020-03-08 22:34:33 -07:00
Jeremy Evans f4394bbca3 Do not autosplat when calling procs that accept rest and keywords
When providing a single array to a block that takes a splat, pass the
array as one argument of the splat instead of as the splat itself,
even if the block also accepts keyword arguments.  Previously, this
behavior was only used for blocks that did not accept keywords.

Implements [Feature#16166]
2020-03-08 20:49:09 -07:00
Nobuyoshi Nakada daa04c5562
Word array instead of splitting 2020-03-08 17:39:22 +09:00
Nobuyoshi Nakada 108f7536b3
Removed unnecessary `chomp`
As `String#split` with the default argument drops trailing newline
as a separator, preceding `String#chomp` is futile.
2020-03-07 17:04:37 +09:00
Takashi Kokubun 9745e90197
Propagate JIT skip to all tests 2020-03-06 20:19:56 -08:00
Koichi Sasada 4c019f5a62 check ar_table after `#hash` call
ar_table can be converted to st_table just after `ar_do_hash()`
function which calls `#hash` method. We need to check
the representation to detect this mutation.
[Bug #16676]
2020-03-07 03:34:17 +09:00
Takashi Kokubun 87ad5ea729
Skip jit_test on some new RubyCI envs for now 2020-03-06 09:38:55 -08:00
Jeremy Evans e79fc05a4c [ruby/prime] Fix Prime.include?
Previously, it would be an infinite loop if passed a non-prime
integer.

Also, Prime.include? should also provide similar results to
Module#include? if passed a Module, so handle that.

For consistency with Enumerable#include?, return false if passed
other object types.

Fixes Ruby Bug 10167.

https://github.com/ruby/prime/commit/55dda6aa7f
2020-03-06 20:54:33 +09:00
Charles Oliver Nutter e57dd8c2b5
Mask RubyVM-specific test 2020-03-05 16:49:27 -06:00
Nobuyoshi Nakada f08cd708b1
Fixed FD leak 2020-03-04 23:26:57 +09:00
Nobuyoshi Nakada 502d9bcd36
Fixed never-defined symbol name 2020-03-04 21:00:17 +09:00
Yusuke Endoh 16415fefc1 test/lib/jit_support.rb: The path to icc was changed 2020-03-04 12:31:55 +09:00
Koichi Sasada ce586107d8 fix 6e271e4cbb 2020-03-04 11:36:34 +09:00
Koichi Sasada 02705b27be Run major GC to make sure the minor GC reason
GC.latest_gc_info[:major_by] can return `oldmalloc` because of
last GC status.
2020-03-04 11:33:55 +09:00
Koichi Sasada 6e271e4cbb Run major GC to make sure the minor GC next time.
`GC.start(full_mark: false)` can run full GC because of last
GC status. Just after major GC, the possibility to run major GC
next time is too small (not a zero, but too small possibility).
2020-03-04 11:31:07 +09:00
Charles Oliver Nutter 03f9e8746e
Don't tweak RubyVM compile options if it's not defined 2020-03-03 08:42:25 -06:00
Yusuke Endoh 501f2c44e6 Suppress an "assigned but unused variable" warning 2020-03-03 20:54:31 +09:00
Nobuyoshi Nakada c8d0bf0156
Preserve `kwarg` flag and fix up f5c904c2a9 2020-03-03 16:19:49 +09:00
Yusuke Endoh 65dd50fc25 Suppress "assigned but unused variable" warnings 2020-03-02 22:37:04 +09:00
Nobuyoshi Nakada f5c904c2a9
Allow newlines inside braced pattern 2020-03-02 15:49:03 +09:00
Koichi Sasada 648eb31b9a Reset Reline.point
TestRelineAsReadline#test_insert_text expects Readline.point == 0
at the beginning of the test, but a test violate this assumption.
2020-03-02 14:42:33 +09:00
Koichi Sasada d348b4adef skip test if Reline.completion_proc is nil.
Some other tests can set Reline.completion_proc, so if it is nil,
simply skip this test.
2020-03-02 13:42:35 +09:00
Koichi Sasada fb377e8f3a Revert "show debug info."
This reverts commit 0bfee2397b.
2020-03-02 13:16:10 +09:00
Koichi Sasada 31c55b6725 need to restore $stdin. 2020-03-02 13:14:38 +09:00
Koichi Sasada 0bfee2397b show debug info.
https://gist.github.com/ko1/a71f7cbcfbd61ba004bffdfedab9f5f2#file-brlog-trunk-random0-20200302-020213-L2127
2020-03-02 11:43:17 +09:00
Kazuki Tsujimoto d25a4f413d
Allow trailing comma in hash pattern 2020-03-01 14:35:48 +09:00
Koichi Sasada 356e032e1a require enc/trans/single_byte in advance.
enc/trans/single_byte is needed to run some tests, however
it will fail to require because $: is empty.
2020-03-01 04:59:27 +09:00
Takashi Kokubun adcf0316d1
Prevent unloading methods used in root_fiber while calling another Fiber (#2939)
Fixing SEGVs like:
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2744905
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2744420
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2741400
2020-02-28 23:58:33 -08:00
Takashi Kokubun a8dcab7233
Avoid infinite loop on --jit-wait 2020-02-28 23:20:44 -08:00
Kazuhiro NISHIYAMA f5b7896921
Fix a typo [ci skip] 2020-02-29 15:14:01 +09:00
aycabta b621c9abd1 Set Readline.completion_append_character = nil always
GNU Readline add a white space when Readline.completion_append_character is
not initialized.
2020-02-29 03:32:36 +09:00
Koichi Sasada cb681c20c0 restore server[:DocumentRootOptions] setting.
Surprisingly (at least for me), `server[:DocumentRootOptions]`
on Webrick is global information and it affect the result of
test_short_filename. Random order test fails because of global
information change. I doubt it is bug, but to fix random order
test, I restore the value.
2020-02-29 00:43:41 +09:00
Koichi Sasada f7be85a2b7 support random order test.
test_readline:
  HISTORY should be empty.

test_using_quoting_detection_proc:
test_using_quoting_detection_proc_with_multibyte_input:
  Readline.completer_quote_characters= and
  Readline.completer_word_break_characters= doesn't accept nil,
  so skip if previous values are nil.
2020-02-28 23:32:56 +09:00
Nobuyoshi Nakada 72c02aa4b7
Moved not-implemented method tests [Bug #16662]
Test not-implemented method with the dedicated methods, instead of
platform dependent features.
2020-02-28 21:15:37 +09:00
aycabta 6df8cfb771 Omit test_using_quoting_detection_proc_with_multibyte_input temporarily for random order test 2020-02-28 19:28:11 +09:00
Koichi Sasada 6787ccf238 setup Other class.
Some tests need to setup Other class with OtherSetup proc.
2020-02-28 17:58:30 +09:00
Jeremy Evans 3556a834a2 Make Module#include affect the iclasses of the module
When calling Module#include, if the receiver is a module,
walk the subclasses list and include the argument module in each
iclass.

This does not affect Module#prepend, as fixing that is significantly
more involved.

Fixes [Bug #9573]
2020-02-27 11:03:13 -08:00
Nobuyoshi Nakada 0686e4181d
Fixed for older versions
Fix up 66d1900423, `RubyVM::MJIT` is
available since ruby 2.6.
2020-02-26 10:16:32 +09:00
Takashi Kokubun 66d1900423
Increase timeout for CSV test with --jit-wait
To prevent CI failures like
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2739995
2020-02-25 09:27:24 -08:00
Nobuyoshi Nakada a504535dd4
Prefer dedicated assertion method 2020-02-25 17:47:17 +09:00
Koichi Sasada 670b7be6c5 should count only string.
This code can generate CC objects so we only need to count
existing String objects.
2020-02-25 13:12:53 +09:00
Nobuyoshi Nakada 8b6e2685a4
Fixed symbol misused as ID
`rb_funcallv_public` and `rb_respond_to` require an `ID`, not a
`Symbol`.  [Bug #16649]
2020-02-24 15:37:52 +09:00
Nobuyoshi Nakada 8a7e0aaaef
Warn non-nil `$/` [Feature #14240] 2020-02-23 13:37:40 +09:00
Nobuyoshi Nakada 6298ec2875
Warn non-nil `$\` [Feature #14240] 2020-02-23 13:37:40 +09:00
Nobuyoshi Nakada 588a86e32c
Warn non-nil `$,` in `IO#print` too 2020-02-23 13:37:40 +09:00
Nobuyoshi Nakada 5b29ea0845
Proc from Symbol needs a receiver
So its arity should be -2 instead of -1.

[Bug #16640]
https://bugs.ruby-lang.org/issues/16640#change-84337
2020-02-22 10:49:59 +09:00
MSP-Greg da31035687 test/readline - allow ENV control of test class creation
In ruby/ruby, the tests run on both readline & reline by creating four test classes:
```
TestReadline
TestReadlineHistory

TestRelineAsReadline
TestRelineAsReadlineHistory
```

Reline inports the test files and uses them in its CI.  Adding the ENV control allows it to only run the `TestRelineAsReadline` classes.
2020-02-22 10:01:09 +09:00
git d7984d0f54 * remove trailing spaces. [ci skip] 2020-02-22 09:59:23 +09:00
Koichi Sasada b9007b6c54 Introduce disposable call-cache.
This patch contains several ideas:

(1) Disposable inline method cache (IMC) for race-free inline method cache
    * Making call-cache (CC) as a RVALUE (GC target object) and allocate new
      CC on cache miss.
    * This technique allows race-free access from parallel processing
      elements like RCU.
(2) Introduce per-Class method cache (pCMC)
    * Instead of fixed-size global method cache (GMC), pCMC allows flexible
      cache size.
    * Caching CCs reduces CC allocation and allow sharing CC's fast-path
      between same call-info (CI) call-sites.
(3) Invalidate an inline method cache by invalidating corresponding method
    entries (MEs)
    * Instead of using class serials, we set "invalidated" flag for method
      entry itself to represent cache invalidation.
    * Compare with using class serials, the impact of method modification
      (add/overwrite/delete) is small.
    * Updating class serials invalidate all method caches of the class and
      sub-classes.
    * Proposed approach only invalidate the method cache of only one ME.

See [Feature #16614] for more details.
2020-02-22 09:58:59 +09:00
Koichi Sasada f2286925f0 VALUE size packed callinfo (ci).
Now, rb_call_info contains how to call the method with tuple of
(mid, orig_argc, flags, kwarg). Most of cases, kwarg == NULL and
mid+argc+flags only requires 64bits. So this patch packed
rb_call_info to VALUE (1 word) on such cases. If we can not
represent it in VALUE, then use imemo_callinfo which contains
conventional callinfo (rb_callinfo, renamed from rb_call_info).

iseq->body->ci_kw_size is removed because all of callinfo is VALUE
size (packed ci or a pointer to imemo_callinfo).

To access ci information, we need to use these functions:
vm_ci_mid(ci), _flag(ci), _argc(ci), _kwarg(ci).

struct rb_call_info_kw_arg is renamed to rb_callinfo_kwarg.

rb_funcallv_with_cc() and rb_method_basic_definition_p_with_cc()
is temporary removed because cd->ci should be marked.
2020-02-22 09:58:59 +09:00
Nobuyoshi Nakada 8c5ca318cb
`Proc` made by `Symbol#to_proc` should be a lambda [Bug #16260]
With refinements, too.
2020-02-22 00:45:05 +09:00
Nobuyoshi Nakada 5cab86f3b0
`Proc` made by `Symbol#to_proc` should be a lambda [Bug #16260] 2020-02-22 00:30:55 +09:00
Nobuyoshi Nakada 5e7322b866 [ruby/irb] `yield` outside method definition is a syntax error
https://github.com/ruby/irb/commit/dbc7b059c7
2020-02-21 23:16:15 +09:00
Hiroshi SHIBATA 9cb1ffaa5c
Promote net-http to the default gems.
test/net/http/test_https.rb: rename fixture methods to read_fixture
  because it conflicts with test-unit gem.
2020-02-21 21:21:14 +09:00
Nobuyoshi Nakada f5abcf767e [ruby/rdoc] Removed `RDoc::Context::Section#sequence`
It has been deprecated since 2011.

https://github.com/ruby/rdoc/commit/5c2aa0f77d
2020-02-20 18:06:19 +09:00
卜部昌平 984e0233fe TestTime#test_memsize: skip when on GC_DEBUG
GC_DEBUG=1 makes this test fail because it changes the size of struct
RVALUE.  I don't think the test is useful then.  Let's just skip.
2020-02-20 11:46:54 +09:00
Takashi Kokubun c4794ed73a
Avoid jumping to a wrong destination
when the next insn is already compiled by former branches.
2020-02-18 23:19:06 -08:00
S-H-GAMELINKS 5fd5666dcc support multi-run test for test_readline.rb 2020-02-19 13:47:33 +09:00
Nobuyoshi Nakada 041c2932e3
Pass keyword arguments to IOs properly [Bug #16639] 2020-02-18 14:35:46 +09:00
Yusuke Endoh 2032432dad Partially revert "test/openssl/test_ssl.rb: skip OpenSSL::TestSSL#test_fallback_scsv"
A skip guard for test_fallback_scsv has been added in upstream
repository.
2020-02-17 20:53:19 +09:00
Kazuki Yamaguchi 8f91dc712a [ruby/openssl] test/openssl/test_ssl: skip test_fallback_scsv if necessary
Run the test case only when the OpenSSL supports both TLS 1.1 and TLS
1.2. Note that the fallback SCSV mechanism is for TLS 1.2 or older and
not for 1.3.

Fixes: https://github.com/ruby/openssl/issues/336

https://github.com/ruby/openssl/commit/6f2e6d7cf7
2020-02-17 20:51:27 +09:00
Kazuki Yamaguchi 99b191d83f [ruby/openssl] ts: simplify OpenSSL::Timestamp::Request#algorithm
Stop the special treatment of invalid hashAlgorithm of the message
imprint. Those invalid values can only appear after the object is
instantiated, before the user sets an actual message digest algorithm.

OpenSSL::Timestamp::TokenInfo#algorithm already does the same.

Also, remove the test case "test_create_request" since it does not make
much sense. Those fields are to be set by the user after creation of
the object and checking the initial value is pointless.

Fixes: https://github.com/ruby/openssl/issues/335

https://github.com/ruby/openssl/commit/890a6476fa
2020-02-17 20:50:47 +09:00
Yusuke Endoh 3fbcdac3e4 test/openssl/test_ssl.rb: skip OpenSSL::TestSSL#test_fallback_scsv
on OpenSSL 1.1.1d or later.

https://github.com/ruby/openssl/issues/336
2020-02-17 13:20:51 +09:00
Yusuke Endoh 331755c5e9 Revert "test/openssl/test_ts.rb: tentatively skip a failing test on CentOS 6.9"
This reverts commit a6d007c70b.

Unfortunately, the test fails on armv7l
https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-9d6766/ruby-master/log/20200216T091708Z.fail.html.gz
2020-02-16 22:16:22 +09:00
Yusuke Endoh a6d007c70b test/openssl/test_ts.rb: tentatively skip a failing test on CentOS 6.9
CentOS 6.9 will be EOL at Nov.  Ruby 3.0 (or 2.8) release version will
not support CentOS 6.9, so I'll remove the environment after it become
green.
2020-02-16 21:20:09 +09:00
Yusuke Endoh e37e0bfa98 test/openssl/test_ssl.rb: skip a test on OpenSSL 1.1.d or later
It fails due to "error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee
key too small".  This is a tentative measurement to avoid the failure.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian/ruby-master/log/20200216T093010Z.fail.html.gz

test/openssl/fixture/chain/server.key should be longer.
It should be documented how to create the files.
BTW, it would be a good idea to dynamically create a key during test
instead of fixed files.
2020-02-16 20:48:40 +09:00
Yusuke Endoh 01138f5853 Make OpenSSL::OSSL#test_memcmp_timing robust
The test was too fragile.  Actually, it fails on one of our CIs
immediately after it was merged to ruby/ruby.

https://gist.github.com/ko1/7ea4a5826641f79e2f9e041d83e45dba#file-brlog-trunk_clang_40-20200216-101730-L532-L535
https://gist.github.com/ko1/1c657746092b871359d8bf9e0ad28921#file-brlog-trunk-test4-20200216-104518-L473-L476

* Two measurements, a-b and a-c, must be interative instead of
  sequential; the execution time will be easily affected by disturbance
  (say, cron job or some external process invoked during measurement)

* The comparison of the two results must be relative instead of
  absolute; slow machine may take several tens of seconds for each
  execution, and one delta second is too small.  The test cases of a, b,
  and c are very extreme, so if the target method has a bug, the two
  execution times would be very different.  So I think it is enough to
  check if the difference is less than 10 times.

This change is the same as https://github.com/ruby/openssl/pull/332
2020-02-16 19:55:19 +09:00
Hiroshi SHIBATA 3014574800
Guard for OpenSSL::PKey::EC::Group::Error with unsupported platforms 2020-02-16 16:08:43 +09:00
Hiroshi SHIBATA b99775b163
Import openssl-2.2.0 (#2693)
Import the master branch of ruby/openssl for preparing to release openssl-2.2.0
2020-02-16 15:21:29 +09:00
Nobuhiro IMAI 961630126b [ruby/irb] fix reserved words and completion for them
https://github.com/ruby/irb/commit/6184b227ad
2020-02-15 21:52:03 +09:00
Yusuke Endoh fb472ca7ad lib/drb/drb.rb: Use ruby2_keywords for keyword separation
[Bug #16634]
2020-02-15 16:27:03 +09:00
Yusuke Endoh fad98c6c61 test/irb/test_completion.rb: suppress a warning: unused literal ignored 2020-02-14 00:07:28 +09:00
Nobuyoshi Nakada fce667ed08
Get rid of warnings/exceptions at cleanup
After the encoding index instance variable is removed when all
instance variables are removed in `obj_free`, then `rb_str_free`
causes uninitialized instance variable warning and nil-to-integer
conversion exception.  Both cases result in object allocation
during GC, and crashes.
2020-02-13 12:46:48 +09:00
S-H-GAMELINKS b1b155ff03 support multi-run test for test/did_you_mean/test_verbose_formatter.rb 2020-02-13 11:07:38 +09:00
S-H-GAMELINKS 778c397310 Fix remove warning & support multi-run test for test/psych/visitors/test_to_ruby.rb 2020-02-13 11:01:15 +09:00
S-H-GAMELINKS 572d9b93bb support multi-run test for test/webrick/test_filehandler.rb 2020-02-13 10:37:40 +09:00
Yusuke Endoh 377c63366f test/rubygems/test_gem_commands_setup_command.rb: Allow /bin/env
Follow up of 65201c054a
2020-02-13 10:16:04 +09:00
Koichi Sasada 53a8b1486b skip SEGV test if RUBY_ON_BUG is specified 2020-02-13 04:20:22 +09:00
Koichi Sasada 99a8742067 should be compared with called_id
me->called_id and me->def->original_id can be different sometimes
so we should compare with called_id, which is mtbl's key.
(fix GH-PR #2869)
2020-02-13 03:30:22 +09:00
John Hawthorn ed7b46b66b Use inline cache for super calls 2020-02-13 00:14:55 +09:00
Nobuyoshi Nakada 160d3165eb
Copy non-inlined encoding index 2020-02-12 20:09:57 +09:00
Nobuyoshi Nakada bdf3032e35
Make temporary lock string encoding free
As a temporary lock string is hidden, it can not have instance
variables, including non-inlined encoding index.
2020-02-12 19:58:22 +09:00
aycabta 15cacf1f55 Add test_complete_symbol
The previous version of the test method used a symbol, ":abcdefg" to complete
but longer symbols that can be completed are defined by other test methods of
other libs.
2020-02-12 19:40:10 +09:00
Yusuke Endoh 65201c054a test/rubygems: Try not only /usr/bin/env but also /bin/env
RubyGems chooses available one from the two

20b0d60948/lib/rubygems/installer.rb (L38)

So, it is good not to hard-code /usr/bin/env in tests.
2020-02-12 17:33:41 +09:00
Yusuke Endoh 2090011dbd test/etc/test_etc.rb: skip some tests on Android
Android user management seems different from normal Unix system.
2020-02-12 17:28:29 +09:00
Nobuyoshi Nakada 52cdf400ef
Workaround of instance variable on hidden object
Since 9d9aea7fe5, generic instance
variables need `iv_index_tbl` in the object's class.  As hidden
objects, however, have no class, access to the variables causes a
segfault.  Get rid of that segfault by raising an exception, for
the time being.
2020-02-12 15:05:29 +09:00
Nobuyoshi Nakada 921916ff9e
Isolate the test for Encoding#replicate
It has global side effect which cannot be reverted.
2020-02-12 14:50:46 +09:00
Hiroshi SHIBATA 166c4a6a28
Revert "[ruby/irb] Add test_complete_symbol"
This reverts commit 3af3431c2c.
2020-02-12 14:38:40 +09:00
aycabta 8b8cc01229 [ruby/irb] Fix auto indent with closed brace
A closed brace in auto-indent shouldn't affect the next brace in the same line,
but it behaves like below:

  p() {
    }

It's a bug.

https://github.com/ruby/irb/commit/fbe59e344f
2020-02-12 13:14:28 +09:00
aycabta 0719e1be11 [ruby/irb] Check doc namespace correctly
IRB::InputCompletor::PerfectMatchedProc crashes when doc not found because a
variable name was incorrect.

https://github.com/ruby/irb/commit/889fd4928f
2020-02-12 13:14:28 +09:00
aycabta 3af3431c2c [ruby/irb] Add test_complete_symbol
https://github.com/ruby/irb/commit/dbbf086c1f
2020-02-12 13:14:28 +09:00
Jeremy Evans 7a288df7b8 Make yield in singleton class definitions in methods a SyntaxError
This behavior was deprecated in 2.7 and scheduled to be removed
in 3.0.

Calling yield in a class definition outside a method is now a
SyntaxError instead of a LocalJumpError, as well.
2020-02-11 12:44:23 -08:00
Nobuyoshi Nakada de3883e782
Restart timer thread even after preparation failed
If the timer thread is left stopped, memory crash or segfault can
happen.
2020-02-11 15:55:10 +09:00
Nobuyoshi Nakada 6e6844320d Fixed duplicated warning
As `command_rhs` is always a "value expression", `command_asgn`
does not need the same check.
2020-02-10 14:00:40 +09:00
Yusuke Endoh 6f04f0cc44 test/ruby/test_thread_queue.rb: add a wait to yield a thread
On Arch, sending a signal in a loop seems hardly to yield the execution.

```
  1) Error:
TestThreadQueue#test_queue_with_trap:
Timeout::Error: execution of assert_in_out_err expired timeout (10 sec)
```
https://rubyci.org/logs/rubyci.s3.amazonaws.com/arch/ruby-master/log/20200209T120002Z.fail.html.gz

This change allows the test to pass.
2020-02-09 21:40:53 +09:00
aycabta fd6746c7a6 [ruby/readline-ext] Use require check instead of DONT_RUN_RELINE_TEST env
https://github.com/ruby/readline-ext/commit/1df99d1481
2020-02-09 20:22:12 +09:00
aycabta ac0658e720 [ruby/readline-ext] Check TestRelineAsReadline existance
https://github.com/ruby/readline-ext/commit/c0a6303168
2020-02-09 20:22:12 +09:00
Nobuyoshi Nakada e3e96e3faa
Check if bindable against the refined target [Bug #16617] 2020-02-09 20:13:49 +09:00
Nobuyoshi Nakada 0f05b234fb
Disable GC until VM objects get initialized [Bug #16616] 2020-02-09 17:15:55 +09:00
S-H-GAMELINKS b76a21aa45 support multi-run test for test/did_you_mean/spell_checking/test_class_name_check.rb 2020-02-07 09:30:43 -05:00
S.H 59a40feec2
remove warning & support multi-run test for test/psych_test_yaml.rb (#2887) 2020-02-07 19:36:10 +09:00
S.H 38ed8cbb5f
remove warning & support multi-run test for test/psych/visitors/test_to_ruby.rb (#2881) 2020-02-07 19:35:52 +09:00
Nobuyoshi Nakada b64b0f3433
Show unmatched sequence on failure 2020-02-07 18:10:36 +09:00
Nobuyoshi Nakada 6ed1a5e0e6
Made a test more robust
Against changes of the `assert_separately` prologue code.
2020-02-07 13:52:53 +09:00
Nobuyoshi Nakada aece5baa75
Removed useless empty lines 2020-02-07 13:44:34 +09:00
Hiroshi SHIBATA 8c67080381
Revert "[rubygems/rubygems] Fix require issue with file extension priority"
This reverts commit d767da428c.

  It fails with spec/ruby/core/kernel/require_spec.rb:5
2020-02-06 22:07:39 +09:00
Hiroshi SHIBATA bd0a02d143
Revert to remove the query command of rubygems.
The original commit was https://github.com/rubygems/rubygems/pull/3119
2020-02-06 21:57:18 +09:00
David Rodríguez d767da428c
[rubygems/rubygems] Fix require issue with file extension priority
If `require "a"` is run when two folders have been specified in the -I
option including a "a.rb" file and a "a.so" file respectively, the ruby
spec says that the ".rb" file should always be preferred. However, the
logic we added in https://github.com/rubygems/rubygems/commit/6b81076d9
to make the -I option always beat default gems does not respect this
spec, creating a difference from the original ruby-core's require.

[the ruby spec says]: d80a6e2b22/core/kernel/shared/require.rb (L234-L246)

https://github.com/rubygems/rubygems/commit/b3944384f4
2020-02-06 21:57:18 +09:00
David Rodríguez c6b5881eae
[rubygems/rubygems] Make non "test_" method private
https://github.com/rubygems/rubygems/commit/912d141a35
2020-02-06 21:57:17 +09:00
Nobuyoshi Nakada 7d6903dc47
Add the loaded feature after no exception raised
Retrying after rescued `require` should try to load the same
library again.  [Bug #16607]
2020-02-04 16:10:39 +09:00
Nobuyoshi Nakada 9cdc964d07
Do not warn CR inside string literal 2020-02-04 14:41:52 +09:00
Lars Kanis 7a51d979cf
Fix inaccuracy in encoding tests
These tests assume
  Encoding.find('locale') == Encoding.find('external')
and fail if they are distinct.
2020-02-04 08:24:59 +09:00
Jean Boussier f2552216d4 Fix SimpleDelegator respond_to? regression
In 2.6, SimpleDelegator would always use the target `respond_to?`

In 2.7.0 it doesn't if the target does not inherit from Object.

This breaks compatibility for delegated objects that inherit
from BasicObject and redefine `respond_to?`.
2020-02-03 08:16:22 -08:00
Seiei Miyagi 11963da9e8 Check type of empty keyword [Bug #16603]
Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>
2020-02-03 17:54:44 +09:00
Yusuke Endoh 0fa43b0c1b test/rubygems/test_gem_remote_fetcher.rb: Remove a duplicated test
https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu1604/ruby-master/log/20200203T003005Z.log.html.gz
```
/home/hsbt/chkbuild/tmp/build/20200203T003005Z/ruby/test/rubygems/test_gem_remote_fetcher.rb:485: warning: method redefined; discarding old test_fetch_path_socket_error
/home/hsbt/chkbuild/tmp/build/20200203T003005Z/ruby/test/rubygems/test_gem_remote_fetcher.rb:167: warning: previous definition of test_fetch_path_socket_error was here
```
2020-02-03 11:51:10 +09:00
Hiroshi SHIBATA 600a715c9b
Merge the current master branch of rubygems/rubygems.
Just started to develop RubyGems 3.2.0.
2020-02-01 11:14:57 +09:00
Nobuyoshi Nakada 9bcf4f3db2
delegate.rb: fixed keyword arguments in DelegateClass
`Delegator.delegating_block` should delegate keyword arguments
separately.  [ruby-core:96949]
2020-01-30 22:13:29 +09:00
Kazuhiro NISHIYAMA d142b37bdc
Add more debug print
https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-master/log/20200129T022510Z.fail.html.gz
2020-01-29 15:00:03 +09:00
Koichi Sasada 7b4b01424f skip SEGV (BUG) tests if ENV['RUBY_ON_BUG'] is given.
This environment variable can show additional message on BUG.
2020-01-29 14:01:00 +09:00
Koichi Sasada 46173eeb64 support multi-run for test/ruby/enc/test_regex_casefold.rb
should not mutate test data.
2020-01-29 13:08:40 +09:00
Koichi Sasada 534536c7cc fix test cleanup.
should remove pathname.
2020-01-29 01:27:17 +09:00
Koichi Sasada 650f152d2f Revert "srand() should not run in tests."
This reverts commit 4d132fa130.

There are discussions about using srand() in tests.
I'll write a ticket about it and continue to discuss.
2020-01-29 00:56:51 +09:00
Koichi Sasada 0cfba9cdd9 Revert "remove debug code."
This reverts commit 65768c80be.
2020-01-29 00:55:11 +09:00
Koichi Sasada e7571f163b restore $LOADED_FEATURES.
Dir.tmpdir can return same directory because of rand() value,
so we shouldn't rely on different name.
2020-01-29 00:54:05 +09:00
Koichi Sasada 7882c43fc3 refactoring: use Proc and Constant. 2020-01-29 00:54:05 +09:00
Tanaka Akira 29e31e72fb ruby_reset_timezone resets leap_second_info.
[Bug #15177]
2020-01-29 00:01:57 +09:00
Koichi Sasada 65768c80be remove debug code. 2020-01-28 18:29:42 +09:00
Koichi Sasada 4d132fa130 srand() should not run in tests.
test_rand.rb calls srand() several times, however it change global
rand-sequence (and --seeds doesn't have meaning). This patch makes
such tests run in other processes.
2020-01-28 18:24:05 +09:00
Koichi Sasada 471a969311 use Minitest::Unit.current_repeat_count to skip multi-run. 2020-01-28 18:20:06 +09:00
Koichi Sasada dd64c34682 support multi-run for test/ruby/test_time.rb
ruby/test_time_tz.rb (not sure only this file affects) changes TZ
and it seems to change internal state. This internal state change
fails test_2038 and test_timegm on 2nd time execution.

At this time I have no idea how to fix this issue, so I skips these
tests on 2nd trial.

You can try this failure with the following command without this patch.

  $ make test-all TESTS='--repeat-count=2 ruby/require ruby/time ruby/time_tz'
2020-01-28 18:15:14 +09:00
Koichi Sasada 151533e4bc support multi-run for test/ruby/test_autoload.rb
Another test defines Object::A, but it will fail 2nd test.
2020-01-28 17:55:18 +09:00
Koichi Sasada 9552262bb2 support multi-run for test/ruby/test_struct.rb
Remove Structs to avoid redefinition warnings.
2020-01-28 15:23:52 +09:00
Koichi Sasada 4df0819c5d support multi-run for test/ruby/test_settracefunc.rb
need to remove Constants.
2020-01-28 15:23:51 +09:00
Koichi Sasada 0f03c1433e support multi-run for test/ruby/test_primitive.rb
need to redefine some classes.
2020-01-28 15:23:51 +09:00
Koichi Sasada 9b65bfdc9e support multi-run for test/ruby/test_refinement.rb
Give up to support multi-run:
* test_method_should_use_refinements
* test_instance_method_should_use_refinements

I hope someone can revisit it.
2020-01-28 15:23:51 +09:00
Koichi Sasada 56b0300f24 support multi-run for test/ruby/test_proc.rb
Mysterious error:
`remove_method(:foo) if method_defined?(:foo)` raise an exception
`method `foo' not defined in #<Class:#<TestProc:0x000055d12ff154e0>>`
This patch rename the method name foo to foo_arity to solve it.
2020-01-28 15:23:51 +09:00
Koichi Sasada 1bc731cb65 support multi-run for test/ruby/test_module.rb
add cleanup code in some tests.
2020-01-28 15:23:51 +09:00
Koichi Sasada cc2fe6936c support multi-run for test/ruby/test_method.rb
need to restore a method.
2020-01-28 15:23:51 +09:00
Koichi Sasada ac2b945bc0 support multi-run for test/ruby/test_marshal.rb
need to remove Constants.
2020-01-28 15:23:51 +09:00
Koichi Sasada 251930cea0 support multi-run for test/ruby/test_iseq.rb
need to remove a Constant.
2020-01-28 15:23:51 +09:00
Koichi Sasada 962c7abb13 support multi-run for test/ruby/test_eval.rb
need to remove a Constant.
2020-01-28 15:23:51 +09:00
Koichi Sasada 5f7be6243a support multi-run for test/ruby/test_encoding.rb
Unique encoding name is required.
2020-01-28 15:23:51 +09:00
Koichi Sasada 14759e6907 support multi-run for ruby/test_const.rb
need to redef Constants.
2020-01-28 15:23:51 +09:00
Koichi Sasada 501e7f4959 support multi-run for ruby/test_basicinstructions.rb
cvar should be initialized at first.
2020-01-28 15:23:51 +09:00
Koichi Sasada b17bab7472 support multi-run for ruby/test_autoload.rb
It requires more cleanup.
2020-01-28 15:23:51 +09:00
Koichi Sasada 8dbd5c76a0 support multiple run for test/ruby/test_array.
test-all supports multiple run with option --repeat-count=2
but test_equal_resize doesn't support it.
2020-01-28 15:23:51 +09:00
Nobuyoshi Nakada 1ddc719a56
Check the encoding of `half:` option 2020-01-27 16:12:15 +09:00
Nobuyoshi Nakada af899503a6
Moved `GC.verify_compaction_references` to gc.rb
And fixed a segfault by coercion of `Qundef`, when any keyword
argument without `toward:` option is given.
2020-01-27 10:52:37 +09:00
Kazuhiro NISHIYAMA 838fa941f1
Add more debug print
https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20200125T032406Z.fail.html.gz
```
IMAPTest#test_connection_closed_without_greeting [/export/home/rubyci/chkbuild-tmp/tmp/build/20200125T032406Z/ruby/test/net/imap/test_imap.rb:485]:
[Net::IMAP::Error] exception expected, not #<RuntimeError: {:"server before close"=>"#<TCPServer:fd 10, AF_INET6, ::1, 48515>", :sock_addr=>["AF_INET6", 48515, "::1", "::1"], :sock_peeraddr=>["AF_INET6", 35223, "::1", "::1"], :e=>#<Errno::EINVAL: Invalid argument - connect(2) for [::1]:48515>, :server=>#<TCPServer:(closed)>, :port=>48515, :server_addr=>"::1"}>.
```
2020-01-26 20:03:27 +09:00
aycabta 0aa5195262 Use test_mode on Reline::History::Test for encoding 2020-01-26 12:58:25 +09:00
Yusuke Endoh b4711a0fa0 test/rinda/test_rinda.rb: Increase the timeout
Attempts to fix a occational failure on Solaris with sunc

https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11-sunc/ruby-master/log/20200124T160008Z.fail.html.gz
```
  1) Error:
Rinda::TestRingServer#test_do_reply:
Timeout::Error: timeout
```
2020-01-25 14:14:05 +09:00
Nobuyoshi Nakada 0c436bbfbf
Recheck array length after `to_str` conversion
https://hackerone.com/reports/244787
2020-01-25 14:06:38 +09:00
Nobuyoshi Nakada 2b2821acd3
Recheck elements type after `to_str` conversion
https://hackerone.com/reports/244786
2020-01-25 13:57:33 +09:00
Jeremy Evans c1d8829ef5 Do not autosplat when calling proc with empty keyword splat
With the removal of the splatted argument when using an empty
keyword splat, the autosplat code considered an empty keyword
splat the same as no argument at all.  However, that results
in autosplat behavior changing dependent on the content of
the splatted hash, which is not what anyone would expect or
want.  This change always skips an autosplat if keywords were
provided.

Fixes [Bug #16560]
2020-01-24 13:04:14 -08:00
卜部昌平 a19228f878 brace the fact that lchmod(2) can EOPNOTSUPP
Musl libc has this function as a tiny wrapper of fchmodat(3posix).  On
the other hand Linux kernel does not support changing modes of a symlink.
The operation always fails with EOPNOTSUPP.  This fchmodat behaviour is
defined in POSIX.  We have to take care of such exceptions.
2020-01-24 10:49:35 +09:00
卜部昌平 50925b6409 reroute musl unistd.h weirdness
Musl is (of course) not glibc.  Its confstr(3) does not understand
_CS_GNU_LIBC_VERSION.  That's fair.  Problem is, its unistd.h has that
constant defined for unknown reason.  We cannot blindly say the libc is
glibc by looking at it.  Instead we have to kick it, then see if it
quacks like a duck.

See https://git.musl-libc.org/cgit/musl/tree/include/unistd.h
2020-01-24 10:49:35 +09:00
卜部昌平 3b9f36d6c6 pass appropriate libc path
The same as https://github.com/ruby/ruby/pull/2686, but for musl libc.
Musl is not named as libc.so.6 so the `ldd` hack implemented some lines
below does not work.
2020-01-24 10:49:35 +09:00
Jeremy Evans f8a8f05512 Remove empty keyword splats when calling even when using ruby2_keywords
Keeping empty keyword splats for ruby2_keywords methods was
necessary in 2.7 to prevent the final positional hash being
treated as keywords.  Now that keyword argument separation
has been committed, the final positional hash is never
treated as keywords, so there is no need to keep empty
keyword splats when using ruby2_keywords.
2020-01-23 09:30:29 -08:00
Benoit Daloze 0ea759eac9 Add more direct test for pp with a ruby2_keywords Hash 2020-01-23 10:59:26 +01:00
Yuta Iwama be6931f7f7 Add #verify_hostname= and #verify_hostname to skip hostname verification (#2858)
According to https://github.com/ruby/openssl/pull/60,

> Currently an user who wants to do the hostname verification needs to
call SSLSocket#post_connection_check explicitly after the TLS connection
is established.

if an user who wants to skip the hostname verification,
SSLSocket#post_connection_check doesn't need to be called

https://bugs.ruby-lang.org/issues/16555
2020-01-23 17:23:17 +09:00
aycabta 890200e85e Check DONT_RUN_RELINE_TEST envvar 2020-01-23 13:35:45 +09:00
aycabta 0d3e4b8a79 Use omit instead of skip 2020-01-23 13:31:19 +09:00
aycabta f09c1cf0e9 Skip a test that uses assert_ruby_status if it doesn't exist 2020-01-23 13:31:19 +09:00
aycabta a737f0cea5 Stop using minitest dependent methods 2020-01-23 13:31:19 +09:00
Jeremy Evans 28d31ead34 Fix pp when passed a empty ruby2_keywords-flagged hash as array element
This causes problems because the hash is passed to a block not
accepting keywords.  Because the hash is empty and keyword flagged,
it is removed before calling the block.  This doesn't cause an
ArgumentError because it is a block and not a lambda.  Just like
any other block not passed required arguments, arguments not
passed are set to nil.

Issues like this are a strong reason not to have ruby2_keywords
by default.

Fixes [Bug #16519]
2020-01-22 10:27:02 -08:00