Commit graph

64 commits

Author SHA1 Message Date
Soutaro Matsumoto
42c08e458d
Fix RBS tests (#14220)
Some checks failed
Windows / Windows 2025/Visual C++ 2022 (test-bundled-gems) (push) Waiting to run
Windows / Windows 2022/Visual C++ 2022 (check) (push) Waiting to run
Windows / Windows 2025/Visual C++ 2022 (check) (push) Waiting to run
Windows / result (push) Blocked by required conditions
Ubuntu on WSL / wsl (push) Waiting to run
BASERUBY Check / BASERUBY (push) Failing after 52s
Annocheck / test-annocheck (push) Failing after 59s
Check Dependencies / Dependency checks (push) Failing after 55s
Misc / Miscellaneous checks (push) Failing after 1m2s
CodeQL / Analyze (push) Failing after 56s
Compilations / omnibus compilations, trigger (push) Failing after 52s
Update default gems list / Update default gems list (push) Has been skipped
parse.y / make (check) (push) Failing after 55s
parse.y / make (test-bundled-gems) (push) Failing after 56s
bundled_gems / update (push) Failing after 1m36s
parse.y / make (test-bundler-parallel) (push) Failing after 55s
Compilations / omnibus compilations, #1 (push) Has been skipped
WebAssembly / make (map[debugflags: name:O2 optflags:-O2 wasmoptflags:-O2]) (push) Failing after 55s
Compilations / omnibus compilations, #2 (push) Has been skipped
Compilations / omnibus compilations, #3 (push) Has been skipped
Compilations / omnibus compilations, #4 (push) Has been skipped
Compilations / omnibus compilations, #5 (push) Has been skipped
Compilations / omnibus compilations, #6 (push) Has been skipped
Compilations / omnibus compilations, #7 (push) Has been skipped
Compilations / omnibus compilations, #8 (push) Has been skipped
Compilations / omnibus compilations, #9 (push) Has been skipped
Compilations / omnibus compilations, #10 (push) Has been skipped
Compilations / omnibus compilations, #11 (push) Has been skipped
Compilations / omnibus compilations, #12 (push) Has been skipped
Compilations / omnibus compilations, result (push) Successful in 58s
* Use unreleased version of rbs
* Skip all failing tests on windows
2025-08-15 04:54:54 +00:00
Takashi Kokubun
c8233db221
Ignore net-imap failures on Windows (#14216)
Some checks failed
Annocheck / test-annocheck (push) Failing after 1m2s
Check Dependencies / Dependency checks (push) Failing after 58s
Misc / Miscellaneous checks (push) Failing after 1m0s
CodeQL / Analyze (push) Failing after 56s
parse.y / make (test-bundled-gems) (push) Failing after 57s
parse.y / make (test-bundler-parallel) (push) Failing after 55s
WebAssembly / make (map[debugflags: name:O2 optflags:-O2 wasmoptflags:-O2]) (push) Failing after 53s
Compilations / omnibus compilations, #1 (push) Has been skipped
Compilations / omnibus compilations, #2 (push) Has been skipped
Compilations / omnibus compilations, #3 (push) Has been skipped
Compilations / omnibus compilations, #6 (push) Has been skipped
Compilations / omnibus compilations, #10 (push) Has been skipped
Windows / Windows 11-arm/Visual C++ (btest test-basic test-tool) (push) Waiting to run
Windows / Windows 2022/Visual C++ 2022 (check) (push) Waiting to run
Windows / Windows 2025/Visual C++ 2022 (check) (push) Waiting to run
Windows / Windows 2025/Visual C++ 2022 (test-bundled-gems) (push) Waiting to run
Windows / result (push) Blocked by required conditions
Ubuntu on WSL / wsl (push) Waiting to run
BASERUBY Check / BASERUBY (push) Failing after 53s
Compilations / omnibus compilations, trigger (push) Failing after 53s
Update default gems list / Update default gems list (push) Has been skipped
parse.y / make (check) (push) Failing after 56s
Compilations / omnibus compilations, #4 (push) Has been skipped
Compilations / omnibus compilations, #5 (push) Has been skipped
Compilations / omnibus compilations, #7 (push) Has been skipped
Compilations / omnibus compilations, #8 (push) Has been skipped
Compilations / omnibus compilations, #9 (push) Has been skipped
Compilations / omnibus compilations, #11 (push) Has been skipped
Compilations / omnibus compilations, #12 (push) Has been skipped
Compilations / omnibus compilations, result (push) Successful in 1m0s
2025-08-13 17:59:50 -07:00
Nobuyoshi Nakada
6b2d9ed2a5
Handle preperly comments in middle of lines in gems/bundled_gems 2025-08-12 16:04:57 +09:00
Jeremy Evans
3a9c091cf3 Simplify Set#inspect output
As Set is now a core collection class, it should have special inspect
output.  Ideally, inspect output should be suitable to eval, similar
to array and hash (assuming the elements are also suitable to eval):

  set = Set[1, 2, 3]
  eval(set.inspect) == set # should be true

The simplest way to do this is to use the Set[] syntax.

This deliberately does not use any subclass name in the output,
similar to array and hash. It is more important that users know they
are dealing with a set than which subclass:

  Class.new(Set)[]
  # this does: Set[]
  # not: #<Class:0x00000c21c78699e0>[]

This inspect change breaks the power_assert bundled gem tests, so
add power_assert to TEST_BUNDLED_GEMS_ALLOW_FAILURES in the workflows.

Implements [Feature #21389]
2025-06-25 09:21:07 +09:00
Hiroshi SHIBATA
4eaa245fcc
Restore ignored test target for mswin 2025-06-18 17:15:47 +09:00
Hiroshi SHIBATA
332f83d1ab
Enabled the released versions of bundled gems that are working fine with Ruby HEAD 2025-06-18 16:13:12 +09:00
Hiroshi SHIBATA
f0d32ee8d3 net-imap and irb are not working with dev version of RDoc
Because they are required markdown.rb provided by release package.
2025-06-18 13:45:31 +09:00
Hiroshi SHIBATA
39ba16e5a1 Re-enabled repl_type_completor test with upstream fix
https://github.com/ruby/repl_type_completor/pull/62
2025-04-30 16:59:25 +09:00
Jeremy Evans
e4f85bfc31 Implement Set as a core class
Set has been an autoloaded standard library since Ruby 3.2.
The standard library Set is less efficient than it could be, as it
uses Hash for storage, which stores unnecessary values for each key.

Implementation details:

* Core Set uses a modified version of `st_table`, named `set_table`.
  than `s/st_/set_/`, the main difference is that the stored records
  do not have values, making them 1/3 smaller. `st_table_entry` stores
  `hash`, `key`, and `record` (value), while `set_table_entry` only
  stores `hash` and `key`.  This results in large sets using ~33% less
  memory compared to stdlib Set.  For small sets, core Set uses 12% more
  memory (160 byte object slot and 64 malloc bytes, while stdlib set
  uses 40 for Set and 160 for Hash).  More memory is used because
  the set_table is embedded and 72 bytes in the object slot are
  currently wasted. Hopefully we can make this more efficient and have
  it stored in an 80 byte object slot in the future.

* All methods are implemented as cfuncs, except the pretty_print
  methods, which were moved to `lib/pp.rb` (which is where the
  pretty_print methods for other core classes are defined).  As is
  typical for core classes, internal calls call C functions and
  not Ruby methods.  For example, to check if something is a Set,
  `rb_obj_is_kind_of` is used, instead of calling `is_a?(Set)` on the
  related object.

* Almost all methods use the same algorithm that the pure-Ruby
  implementation used.  The exception is when calling `Set#divide` with a
  block with 2-arity.  The pure-Ruby method used tsort to implement this.
  I developed an algorithm that only allocates a single intermediate
  hash and does not need tsort.

* The `flatten_merge` protected method is no longer necessary, so it
  is not implemented (it could be).

* Similar to Hash/Array, subclasses of Set are no longer reflected in
  `inspect` output.

* RDoc from stdlib Set was moved to core Set, with minor updates.

This includes a comprehensive benchmark suite for all public Set
methods.  As you would expect, the native version is faster in the
vast majority of cases, and multiple times faster in many cases.
There are a few cases where it is significantly slower:

* Set.new with no arguments (~1.6x)
* Set#compare_by_identity for small sets (~1.3x)
* Set#clone for small sets (~1.5x)
* Set#dup for small sets (~1.7x)

These are slower as Set does not currently use the AR table
optimization that Hash does, so a new set_table is initialized for
each call.  I'm not sure it's worth the complexity to have an AR
table-like optimization for small sets (for hashes it makes sense,
as small hashes are used everywhere in Ruby).

The rbs and repl_type_completor bundled gems will need updates to
support core Set.  The pull request marks them as allowed failures.

This passes all set tests with no changes.  The following specs
needed modification:

* Modifying frozen set error message (changed for the better)
* `Set#divide` when passed a 2-arity block no longer yields the same
  object as both the first and second argument (this seems like an issue
  with the previous implementation).
* Set-like objects that override `is_a?` such that `is_a?(Set)` return
  `true` are no longer treated as Set instances.
* `Set.allocate.hash` is no longer the same as `nil.hash`
* `Set#join` no longer calls `Set#to_a` (it calls the underlying C
   function).
* `Set#flatten_merge` protected method is not implemented.

Previously, `set.rb` added a `SortedSet` autoload, which loads
`set/sorted_set.rb`.  This replaces the `Set` autoload in `prelude.rb`
with a `SortedSet` autoload, but I recommend removing it and
`set/sorted_set.rb`.

This moves `test/set/test_set.rb` to `test/ruby/test_set.rb`,
reflecting that switch to a core class.  This does not move the spec
files, as I'm not sure how they should be handled.

Internally, this uses the st_* types and functions as much as
possible, and only adds set_* types and functions as needed.
The underlying set_table implementation is stored in st.c, but
there is no public C-API for it, nor is there one planned, in
order to keep the ability to change the internals going forward.

For internal uses of st_table with Qtrue values, those can
probably be replaced with set_table.  To do that, include
internal/set_table.h.  To handle symbol visibility (rb_ prefix),
internal/set_table.h uses the same macro approach that
include/ruby/st.h uses.

The Set class (rb_cSet) and all methods are defined in set.c.
There isn't currently a C-API for the Set class, though C-API
functions can be added as needed going forward.

Implements [Feature #21216]

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
Co-authored-by: Oliver Nutter <mrnoname1000@riseup.net>
2025-04-26 10:31:11 +09:00
Hiroshi SHIBATA
9f61541f76 Re-enabled to test at win32ole 2025-04-09 15:51:08 +09:00
Hiroshi SHIBATA
d485638a08 Allow win32ole test failure
```
D:/a/ruby/ruby/src/gems/src/win32ole/test/win32ole/test_win32ole_event.rb:80:in 'TestWIN32OLE_EVENT_SWbemSink#default_handler': undefined method '+' for nil (NoMethodError)
```

4007208388
2025-04-07 15:10:58 +09:00
Hiroshi SHIBATA
be5dea9720 Rename test command for test-unit
b7d3c32f6e
2025-04-07 15:10:58 +09:00
Nobuyoshi Nakada
eb765913c1
Console Cntl event is sent to root process sharing the console 2025-04-04 19:34:04 +09:00
Nobuyoshi Nakada
cec45aedb5
Cannot send signal to process group on Windows 2025-04-04 16:24:49 +09:00
Nobuyoshi Nakada
d22e766042
Cannot send SIGTERM to another process on Windows 2025-04-04 16:24:48 +09:00
Hiroshi SHIBATA
141f2924ee The test of net-smtp-0.5.1 is working with Windows platform now 2025-02-05 17:15:30 +09:00
Hiroshi SHIBATA
62b8792109 Skip irb on test-bundled-gems with Windows 2025-02-05 07:36:59 +09:00
Hiroshi SHIBATA
8d319edf38
Skip win32ole tests without Windows platform 2025-01-16 12:35:21 +09:00
Hiroshi SHIBATA
68e2022b5b The test of net-imap is passed with Windows 2024-12-19 12:20:22 +09:00
Hiroshi SHIBATA
69fb4a5f38
typeprof-757303fe8de0cf5e5583b4a76f8abbbd55c44776 is working with Windows 2024-12-06 20:01:37 +09:00
Hiroshi SHIBATA
84bf0b3774 Always declared gems that are test failures on Windows to allowed failures list 2024-11-28 14:56:46 +09:00
Hiroshi SHIBATA
ac7b63e353 Fixed test condition for specified bundled gems 2024-11-27 16:45:10 +09:00
Hiroshi SHIBATA
9349e98be2 Allow to run 'make test-bundled-gems BUNDLED_GEMS=csv,rexml' for only testing csv and rexml 2024-11-27 16:45:10 +09:00
Nobuyoshi Nakada
4bcfff07ab
Remove debug print 2024-11-01 02:33:11 +09:00
Nobuyoshi Nakada
0fda818bd7
Make gemspec files for default gems with extensions
So that rubygems can find them as gems.  However, the `--install-dir`
option of `gem install` seems to exclude prerelease gems, even already
installed in that directory, from the dependencies for some reasons;
use the `GEM_HOME` environment variable instead.

Now net-imap 0.5.0 depends on json gem.
2024-11-01 02:33:10 +09:00
Nobuyoshi Nakada
e994015c00 Update test-bundled-gems.rb
- Fix filtering by ARGV
- Adjust top library names from gem names
- Skip if no tests found
2024-10-28 23:39:39 +09:00
Hiroshi SHIBATA
31a5d4a0cd Skip test task for resolv-replace 2024-01-19 17:44:58 +09:00
Hiroshi SHIBATA
27ead9907d
Typofix under lib and test, tool directories 2023-12-25 11:32:42 +09:00
Nobuyoshi Nakada
c86c6a84f5 [Bug #19968] Revert RBS revision to test
This reverts the commits for the master branch of RBS:

- commit f717faac63: "Update rbs
  revision to test"

    The target revision to test is in master branch, not for 3.2.x.

- commit 9e93af5329: "Skip RBS
  `RbConfig::TOPDIR` test that is `nil` before installation"

    RbConfig_test.rb is not updated in 3.2.x branch.
2023-10-24 22:59:09 +09:00
Nobuyoshi Nakada
9e93af5329 Skip RBS RbConfig::TOPDIR test that is nil before installation 2023-10-22 08:44:52 +09:00
Nobuyoshi Nakada
0ca5182ae5 RBS no longer has test/stdlib/Prime_test.rb 2023-10-22 08:44:52 +09:00
Nobuyoshi Nakada
b76c2ec005
Use :: form workflow commands 2023-08-15 23:30:40 +09:00
Nobuyoshi Nakada
c5c15a565b Allow test-unit-ruby-core files to be loaded from bundled gems
Separate the directly from the customized test-unit, since it may not
work with bundled gems.
2023-06-14 12:14:20 +09:00
Hiroshi SHIBATA
f6e6d52b22 Try to skip Prime_test.rb 2023-06-12 13:18:28 +09:00
Hiroshi SHIBATA
8be4659b60 Run test-unit test without rake task to avoid yard dependency 2023-06-12 13:18:28 +09:00
Soutaro Matsumoto
1abec43b5d
Fix rbs (#7415)
* Update RBS to skip validation task
* Revert TEST_BUNDLED_GEMS_ALLOW_FAILURES
2023-03-02 12:59:04 +09:00
Soutaro Matsumoto
6af6857ecf
Set up RBS_SKIP_TESTS (#6862)
* Set up RBS_SKIP_TESTS
2022-12-21 22:11:51 +09:00
Nobuyoshi Nakada
6d6b1e5990
Display error messages outside the groups so can be found quickly 2022-12-12 23:32:37 +09:00
Alan Wu
574d849869 Run skipped minitest tests that now pass
The mentioned PR was merged.
2022-11-19 10:36:51 +09:00
Nobuyoshi Nakada
464f73a5f0
Do not load library files from repository only for test
What we want to test should be the bundled and to be installed files,
but not the upstream.
2022-07-27 17:36:45 +09:00
Nobuyoshi Nakada
b291c972fa Use built bundled gems in test-bundled-gems 2022-07-25 08:50:07 +09:00
Nobuyoshi Nakada
e0a7e5e131
Kill bundled gem tests when interrupted 2022-07-24 16:36:33 +09:00
Nobuyoshi Nakada
5101671cbc
Disable parallel built in test-bundled-gems 2022-07-16 15:28:05 +09:00
Nobuyoshi Nakada
1150a54afe
Use File::PATH_SEPARATOR for the portability 2022-07-09 19:00:56 +09:00
Hiroshi SHIBATA
cc50e57bf5
Relax extention name for macOS 2021-11-15 16:52:10 +09:00
Soutaro Matsumoto
dee2e9b2be
Bundle RBS 1.7.0 (#5105)
* Bundle RBS 1.7.0

* tool/test-bundled-gems.rb: Use a correct path to Check if rbs is built

* tool/test-bundled-gems.rb: lib/rbs/parse.y is no longer created

Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>
2021-11-12 02:01:53 +09:00
Yusuke Endoh
efe7e6e949 Bundle rbs 1.7.0.beta.5 2021-11-09 03:32:46 +09:00
Koichi Sasada
bc96a45f12 introduce debug.gem
For the `test-bundled-gems`, make `debug.so` with extconf.rb and
`make` command directly because `rake-compiler` assume ruby is
installed (but `test-bundled-gems` can run without installation).
2021-10-05 02:07:33 +09:00
Yusuke Endoh
b44741f5dc tool/test-bundled-gems.rb: Use the bundled RBS code to test TypeProf
Formerly, TypeProf was tested with the latest RBS code during
`make test-bundled-gems`. However, when a new version of rbs is
released, and if it is incompatible with TypeProf,
`make test-bundled-gems` starts failing, which was annoying.

By this change, TypeProf is tested with the bundled version of RBS.
2021-08-25 11:13:17 +09:00
Yusuke Endoh
4a6b5f4622 Revert "tool/test-bundled-gems.rb: Use the bundled RBS code to test TypeProf"
This reverts commit 22deda43cb.

It was incomplete. Sorry!
2021-08-24 18:08:16 +09:00