Commit graph

16692 commits

Author SHA1 Message Date
st0012
2733c04967 [ruby/reline] Add tests for top-level dialog color APIs
347a468c59
2022-07-11 22:19:44 +09:00
Matt Valentine-House
6423d32e3b Replace use of double_heap in tests with expand_heap 2022-07-11 09:00:03 -04:00
Takashi Kokubun
fae568edbe
Use NO_JIT_DESCRIPTION only when needed
Apparently 203801566a broke YJIT's CI.
2022-07-10 23:58:19 -07:00
Takashi Kokubun
203801566a
Fix #5872 for MJIT GitHub Actions
If you run tests with RUN_OPTS=--mjit, the test fixes in
https://github.com/ruby/ruby/pull/5872 don't work.
2022-07-10 23:10:36 -07:00
Nobuyoshi Nakada
da21a2c388 [ruby/rdoc] RubyVM is implementation dependent
aaeb5ce1ce
2022-07-11 13:43:15 +09:00
Nobuyoshi Nakada
b564ef3698 [ruby/rdoc] Fix the known classes more
9f47234e0e
2022-07-11 13:43:14 +09:00
Nobuyoshi Nakada
86df6f4bb3 [ruby/rdoc] Fix an exception class name
87301da71b
2022-07-11 13:14:06 +09:00
Nobuyoshi Nakada
949c3afb48 [ruby/openssl] Skip a new test when old OpenSSL
It does not raise an error when setting an invalid value to SSLContext
ciphers on Ubuntu 18.04.

8c96a69b0d
2022-07-09 15:26:32 +09:00
Nobuyoshi Nakada
d77ebe8eea
[ruby/openssl] Strip trailing spaces [ci skip]
862d92de93
2022-07-09 00:39:18 +09:00
Jarek Prokop
4d6a29320d [ruby/openssl] Let OpenSSL choose the digest if digest for Openssl::OCSP::BasicResponse#sign is nil.
27efcd7e1c
2022-07-08 23:18:22 +09:00
Jeremy Evans
def445303a [ruby/openssl] Fix test of cipher name to pass in LibreSSL 3.4
LibreSSL 3.5 switched the cipher naming to match OpenSSL.

bf198278bd
2022-07-08 23:18:18 +09:00
twkmd12
09daf78fb5 [ruby/openssl] Add 'ciphersuites=' method to allow setting of TLSv1.3 cipher suites along with some unit tests (https://github.com/ruby/openssl/pull/493)
Add OpenSSL::SSL::SSLContext#ciphersuites= method along with unit tests.

12250c7cef
2022-07-08 23:18:11 +09:00
Jeremy Evans
01025a0055 [ruby/openssl] Skip optional wildcard SAN tests on LibreSSL 3.5.0+
RFC 6066 states how some wildcard SAN entries MAY be handled, but
it does not say they MUST be handled.  LibreSSL 3.5.0 only handles
suffix wildcard SANs, not prefix wildcard SANs, or interior
wildcard SANs, so return early from the wildcard SAN tests on
LibreSSL 3.5.0.

Fixes #471

717d7009d6
2022-07-08 23:18:07 +09:00
Nobuyoshi Nakada
4a2662ae8b
[Bug #18890] Suppress warnings and fix the message
```
test/ruby/test_parse.rb:1384: warning: assigned but unused variable - obj
test/ruby/test_pattern_matching.rb:1162: warning: unused literal ignored
test/ruby/test_pattern_matching.rb:1165: warning: unused literal ignored
test/ruby/test_pattern_matching.rb:1161: warning: assigned but unused variable - a
test/ruby/test_pattern_matching.rb:1164: warning: assigned but unused variable - b
```

And a newline should be significant here.
2022-07-08 11:31:51 +09:00
Nobuyoshi Nakada
f1c15f3e94
Relax assertion condition for thread local counters
Recently `TestThreadInstrumentation#test_join_counters` often fails as

```
<[1, 1, 1]> expected but was
<[2, 2, 2]>.
```

Probably it seems that the thread is suspended more than once.
There may be no guarantee that the subject thread never be suspended
more than once.
2022-07-08 10:55:44 +09:00
Jean Boussier
65ae2bb2e0 Thread#value: handle threads killed by a fork
[Bug #18902]

When a thread is killed because we forked, the `value` if left
to `Qundef`. Returning it woudl crash the VM.
2022-07-07 19:49:25 +02:00
Jean Boussier
587d2d199b thread_pthread.c: call SUSPENDED event when entering native_sleep
[Bug #18900]

Thread#join and a few other codepaths are using native sleep as
a way to suspend the current thread. So we should call the relevant
hook when this happen, otherwise some thread may transition
directly from `RESUMED` to `READY`.
2022-07-07 17:49:00 +02:00
Nobuyoshi Nakada
cd94842922 [Bug #18892] Reset ARGF.lineno after reading shebang 2022-07-07 11:33:07 +09:00
Burdette Lamar
7ba5c0633c [ruby/pstore] Emphasize keys instead of roots, values instead of objects (https://github.com/ruby/pstore/pull/7)
Modifies RDoc to Emphasize keys instead of roots, values instead of objects.

Code:

    Renames method #root? to #key? and method #roots to #keys.
    Aliases method #key as #root and method #keys as #roots.
    Adds testing for all four methods.

4436ea0891
2022-07-07 07:05:01 +09:00
Nobuyoshi Nakada
5ef3c7ea2d
[Bug #18898] Fallback invalid external encoding to the default 2022-07-06 18:08:31 +09:00
Nobuyoshi Nakada
eaeb130b11 [Bug #18890] newline should be insignificant after pattern label 2022-07-06 08:32:36 +09:00
Brian Le
902d1a5c51 [rubygems/rubygems] add message when gems are requested to be updated but they are not installed
27953ffe9a
2022-07-06 02:59:14 +09:00
Brian Le
6eab8095fa [rubygems/rubygems] output gems already up-to-date regardless if any gems were updated
4ec608a573
2022-07-06 02:59:13 +09:00
Nobuyoshi Nakada
babdb158d1
Synchronize the test thread not to die before assertions 2022-07-05 13:50:45 +09:00
dependabot[bot]
ed76ba35dd [rubygems/rubygems] Bump rb-sys in /test/rubygems/test_gem_ext_cargo_builder/custom_name
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.15 to 0.9.18.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.15...v0.9.18)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

a862203683
2022-07-05 09:45:42 +09:00
dependabot[bot]
94aff13f88 [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.15 to 0.9.18.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.15...v0.9.18)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

db8486a61e
2022-07-05 09:45:03 +09:00
Jean Boussier
890df5f812 ObjectSpace.dump: Include string coderange
I suspect that some shared pages are invalidated because
some static string don't have their coderange set eagerly.

So the first time they are scanned, the entire memory page is
invalidated.

Being able to see the coderange in `ObjectSpace` would help debug
this.

And in addition `dump` currently call `is_broken_string()`  and `is_ascii_string()`
which both end up scanning the string and assigning coderange. I think it's
undesirable as `dump` should be read only.
2022-07-04 20:04:59 +02:00
Nobuyoshi Nakada
302f353fd9 [ruby/stringio] Fix the result of StringIO#truncate so compatible with File
16847fea32
2022-07-01 00:52:29 +09:00
Yusuke Endoh
8eb5198ccc [rubygems/rubygems] Prevent a warning: `*' interpreted as argument prefix
20220630T063003Z.log.html.gz
```
[19606/21662] TestAst#test_not_cared:test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb(none):18: warning: `*' interpreted as argument prefix
(none):19: warning: `*' interpreted as argument prefix
 = 0.00 s
```

c98f9326e8
2022-06-30 18:53:20 +09:00
Nobuyoshi Nakada
982cda9a3e [Bug #18877] Let lex_ctxt not to eat escaped whitespace 2022-06-30 16:31:51 +09:00
Peter Zhu
66eb58d6bd Refactor tests for moving strings with compaction 2022-06-29 15:11:53 -04:00
Nobuyoshi Nakada
685efac059
[Bug #18884] class cannot be just followed by modifiers 2022-06-29 14:13:15 +09:00
Ian Ker-Seymer
3051d4bc2a [rubygems/rubygems] Support ruby 2.3 and 2.4
3a9205df36
2022-06-29 09:53:14 +09:00
Ian Ker-Seymer
50e576292b [rubygems/rubygems] Upgrade rb-sys to 0.9.14
c9adf3ef1c
2022-06-29 09:53:14 +09:00
David Rodríguez
a16de43f23 [rubygems/rubygems] Add gem env user_gemhome and gem env user_gemdir
14d3f80df6
2022-06-29 03:25:46 +09:00
David Rodríguez
f0fab24241 [rubygems/rubygems] Add missing test for user installation directory
5ab8aa2a45
2022-06-29 03:25:46 +09:00
st0012
a415a3de05 [ruby/irb] Properly reset USE_COLORIZE after changing it in tests
Some context tests assigns USE_COLORIZE to false and never change it
back. This can potentially affect other tests' result as the default
should be nil (activated) instead.

986eb16ece
2022-06-29 00:23:18 +09:00
Tomas Volf
69337a65b2 [rubygems/rubygems] Fix test_install_location_extra_slash on alpine
Under POSIX behavior of leading // is implementation defined. Musl does
preserve it in realpath, glibc does not. That means the test was failing
when executed on alpine linux. Original issue #508 was about // in the
path, not about leading ones. When executed in such environment, the
test will still test what it should when the explicit mangling of the
path is not done.

Fixes #5652

0fa7373bf6
2022-06-28 23:31:33 +09:00
Stan Lo
44c1316293 [ruby/irb] Centralize coloring control (https://github.com/ruby/irb/pull/374)
* Use colorable: argument as the only coloring control

* Centalize color controling logic at Color.colorable?

There are 2 requirements for coloring output:

1. It's supported on the platform
2. The user wants it: `IRB.conf[:USE_COLORIZE] == true`

Right now we check 1 and 2 separately whenever we colorize things.
But it's error-prone because while 1 is the default of `colorable`
parameter, 2 always need to manually checked. When 2 is overlooked, it
causes issues like https://github.com/ruby/irb/pull/362

And there's 0 case where we may want to colorize even when the user
disables it. So I think we should merge 2 into `Color.colorable?` so it
can be automatically picked up.

* Add tests for all inspect modes

* Simplify inspectors' coloring logic

* Replace use_colorize? with Color.colorable?

* Remove Context#use_colorize cause it's redundant

1c53023ac4
2022-06-28 22:30:42 +09:00
Nobuyoshi Nakada
131422ceea [ruby/rdoc] Support attributes defined by rb_struct_define
854b370763
2022-06-28 20:17:30 +09:00
Nobuyoshi Nakada
51be2cf6d2 [ruby/rdoc] Parse also InitVM-prefixed functions
Initialization depending on VM is separated.

030d10fccd
2022-06-28 14:51:49 +09:00
pocari
8c6c3e30f3 [ruby/reline] Enable to change the background color of dialogs. (https://github.com/ruby/reline/pull/413)
bd49537964
2022-06-27 22:28:49 +09:00
David Rodríguez
f83c5de6d5 [rubygems/rubygems] Improve error message when operating_system.rb fails to load
Show an absolute path instead of an unhelpful relative path.

f1eed36e2f
2022-06-27 17:03:24 +09:00
Takashi Kokubun
232e2f5981
Skip TupleSpaceProxyTest on MINGW64 too
It wasn't specific to UCRT64

7062992464
2022-06-26 21:00:04 -07:00
Alan Wu
49d5921550 Fix Rinda test teardown for omitted tests
New test failures on MINGW appeared after
c2e37c8ff7.

      1) Error:
    Rinda::TupleSpaceProxyTest#test_00_template:
    NoMethodError: undefined method `stop_service' for nil:NilClass
        D:/a/ruby/ruby/src/test/rinda/test_rinda.rb:516:in `teardown'

      2) Error:
    Rinda::TupleSpaceProxyTest#test_ruby_talk_264062:
    NoMethodError: undefined method `stop_service' for nil:NilClass
        D:/a/ruby/ruby/src/test/rinda/test_rinda.rb:516:in `teardown'

Teardown happens even when the test is omitted.

See: 7058984522
2022-06-26 09:24:22 -04:00
Takashi Kokubun
c2e37c8ff7
Try skipping TupleSpaceProxyTest on MinGW UCRT64
As you all know, MinGW UCRT64 CI has randomly got stuck despite its
"Finished tests" output.

Looking at the logs closely, it seems like all of the recent such
reproductions end with the following output:

```
  Retrying hung up testcases...
  [ 1/14] Rinda::TupleSpaceProxyTest#test_ruby_talk_264062 = 0.21 s
  [ 2/14] Rinda::TupleSpaceProxyTest#test_00_template = 0.01 s
  [ 3/14] Rinda::TupleSpaceProxyTest#test_inp_rdp = 0.00 s
  [ 4/14] Rinda::TupleSpaceProxyTest#test_core_03_notify = 0.01 s
  [ 5/14] Rinda::TupleSpaceProxyTest#test_00_renewer = 0.01 s
  [ 6/14] Rinda::TupleSpaceProxyTest#test_cancel_02 = 0.11 s
  [ 7/14] Rinda::TupleSpaceProxyTest#test_00_DRbObject = 0.00 s
  [ 8/14] Rinda::TupleSpaceProxyTest#test_core_02 = 0.11 s
  [ 9/14] Rinda::TupleSpaceProxyTest#test_core_01 = 0.11 s
  [10/14] Rinda::TupleSpaceProxyTest#test_remote_array_and_hash = 0.01 s
  [11/14] Rinda::TupleSpaceProxyTest#test_00_tuple = 0.00 s
  [12/14] Rinda::TupleSpaceProxyTest#test_take_bug_8215 = 0.41 s
  [13/14] Rinda::TupleSpaceProxyTest#test_cancel_01 = 0.11 s
  [14/14] Rinda::TupleSpaceProxyTest#test_symbol_tuple = 0.01 s
  Finished tests in 719.252845s, 29.4292 tests/s, 3838.7154 assertions/s.
  21167 tests, 2761007 assertions, 0 failures, 0 errors, 708 skips
```

7057789554

While it seems to be retried successfully, given that it hungs up once
and this appears all the time, this test class seems a bit suspicious.
To check if it's related, let me try disabling this for now.
2022-06-25 23:36:14 -07:00
Nobuyoshi Nakada
0e5f9afff6 [ruby/irb] Set prompt mode explictly
Fix https://github.com/ruby/irb/pull/353

7db93f9326
2022-06-26 15:23:33 +09:00
Nobuyoshi Nakada
a2b3f2014c [ruby/irb] Require stringio to use StringIO
e024ab716b
2022-06-26 15:23:32 +09:00
Peter Jones
e0bfdb23af [ruby/irb] Ensure stdout is a TTY before calling winsize
When outputting a (possibly truncated) value, IRB will query the
window size.  However, if IRB was piped to another process, stdout
will no longer be a TTY and will not support the `winsize` method.

This fix ensure that stdout is a TTY.

125de5eeea
2022-06-26 14:40:48 +09:00
Tomas Volf
56809537a4 [rubygems/rubygems] Clean up temporary directory after generate_index --update
While generate_index did clean up temporary directory, when running with
--update flag, that did not happen and the temporary directory was left
behind.

This commit fixes that and modifies tests in order to make sure this is
not reintroduced later on.

Fixes #5635.

9fa34dc329
2022-06-26 11:15:43 +09:00