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

15 Коммитов

Автор SHA1 Сообщение Дата
Yusuke Endoh 5bf75c20a2 Refactor the settings of test-all out
test/runner.rb and tool/lib/test/unit/parallel.rb must use the same
settings. However, some settings were copied and pasted, while some were
added only to test/runner.rb.
This changeset creates tool/test/init.rb for all settings of test-unit,
which is loaded not only by test/runner.rb but also
tool/lib/test/unit/parallel.rb.

Background: the GEM_HOME environment variable was removed in
test/runner.rb, which prohibit `require "rake"` (note that rake is a
bundled gem). However the parallel mode didn't refrect this setting,
i.e., `require "rake"` was allowed.
This leads to an inconsistency, which actually affected a test test
defines s test class *only when* `require "rake"` is successful.
(test/rubygems/test_gem_package_task.rb)

https://github.com/ruby/ruby/actions/runs/6807729617/job/18511055636#step:8:1714
```
  /home/runner/work/ruby/ruby/src/tool/lib/test/unit.rb:729:in `const_get': uninitialized constant TestGemPackageTask (NameError)

                suites.map! {|r| ::Object.const_get(r[:testcase])}
                                         ^^^^^^^^^^
```
2023-11-15 19:27:10 +09:00
Nobuyoshi Nakada 6b46057e5c
Expand the test directory to real path
When the test source directory path contains symbolic links, that
directory might be placed earlier in the result of
`IRB::InputCompletor.retrieve_gem_and_system_load_path`, than other
directories in the source tree that are expanded to the real path.  In
that case, the test file in "csv" under the test directory of csv gem
instead of the library path will be the first candidate, in
`TestIRB::TestCompletion#test_complete_require_library_name_first`.

```
<"'csv"> expected but was
<"'csv/helper">.
```
2023-03-03 15:30:02 +09:00
Nobuyoshi Nakada cc33d07f46
Disable experimental warnings in test/runner.rb 2021-11-10 17:42:09 +09:00
Samuel Williams 81d0ce7e97 Mark IO::Buffer as experimental. 2021-11-10 19:21:05 +13:00
Koichi Sasada 228b3e43be check GC.enable'd status
Check GC.enable'd status before and after test execution.

Write this checker in gc_checker.rb, it was renamed from
gc_compact_checker.rb.
2021-08-05 17:11:50 +09:00
Koichi Sasada 79eb5e1aca call GC.compact after each test.
RUBY_TEST_GC_COMPACT=1 enables GC.compact checker which calls
GC.compact after each test.
2019-12-12 03:32:12 +09:00
Koichi Sasada 84cbce3d88 Enable checkers on parallel test.
parallel test (`make test-all TESTS=-j8`) runs tests on specified
number of processes. However, some test checkers written in
`runner.rb` are not loaded. This fix enable these checkers on
parallel tests.

See also: https://github.com/ruby/ruby/pull/2508
2019-10-02 16:23:00 +09:00
Nobuyoshi Nakada 7e33f324e1
Get rid of failures about coverage
Run test suites explicitly instead of auto-running, to get rid of
failures when simplecov is not installed but COVERAGE is set.
2019-07-25 20:57:32 +09:00
Nobuyoshi Nakada 8e53d18e67
Separated tool/test/runner.rb and test/runner.rb
As `make test-tool` does not use gems, and no Rubygems stuffs is
needed, so moved such things to test/runner.rb.  Also no longer
nees `--test-target-dir` option.
2019-07-25 16:57:38 +09:00
Nobuyoshi Nakada a850be68a5
Moved NoMemoryError hook to Test::Unit::AutoRunner 2019-07-25 08:42:16 +09:00
Nobuyoshi Nakada dc954cbb75
@@project_dir in Gem::TestCase is no longer used 2019-07-24 20:08:40 +09:00
Nobuyoshi Nakada d1c2b19698
Fixed exception message 2019-07-22 13:51:14 +09:00
Nobuyoshi Nakada f6461fa890
Only the first argument can be --test-target-dir option
Raise the proper exception when that option is not given but
non-option argument is.
2019-07-22 13:07:03 +09:00
Yusuke Endoh 24712eeec3 tool/test/runner.rb: support --test-target-dir option
tool/test/runner.rb had been copied from test/runner.rb.
test/runner.rb was for `make test-all`, and tool/test/runner.rb was for
`make test-testframework` and `make test-tool`.
But I want to avoid the code clones.

This change makes tool/test/runner.rb support --test-target-dir option
which allows tool/test/runner.rb to run `make test-all`.
Now we can remove test/runner.rb.
2019-07-21 19:19:08 +09:00
Hiroshi SHIBATA ac6d137157
Added test-tool target for the test suite of tool/test files. 2019-07-15 11:16:29 +09:00